Skip to content

s-patompong/tswink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

81738b1 · Sep 11, 2019

History

16 Commits
Jul 1, 2019
Oct 26, 2017
Oct 26, 2017
Oct 26, 2017
Sep 11, 2019
Nov 23, 2018
Oct 26, 2017
Oct 26, 2017

Repository files navigation

TS Wink

Generate typescript classes from Laravel models.

Installation

Run composer require pangpondpon/tswink and composer require doctrine/dbal

Note: doctrine/dbal is needed for read table structure to create typescript class files.

If you're using Laravel 5.4 or below, add this to providers array inside config/app.php

TsWink\TswinkServiceProvider::class,

Publish the config using php artisan vendor:publish and select TsWink\TswinkServiceProvider.

Change the config to suite your project

<?php

return [
    // Destination of typescript classes
    'ts_classes_destination' => 'resources/assets/src/models',
];

Usage

Run this artisan command

php artisan tswink:generate

The file will be in your selected directory in config file.

Result Example