laravel-typegen
laravel-typegen copied to clipboard
The library lets you generate TypeScript types from your Laravel code
# Summary When generating, utilize sail artisan instead of php artisan outside of the Sail container to echo model JSON. Within the Docker container, we can invoke php artisan model:show...
Let's assume we have a PostsController like the following in a Laravel project: ```php class PostsController extends Controller { public function index() { $posts = Post::all(); return Inertia::render( 'Posts/Index', [...
use ``` export const GenderType = { Male: "Male", Female: "Female", Other: "Other" } as const ``` instead of ``` export enum GenderType { Male = "Male", Female = "Female",...
 ```php // app/Models/BasicInformation.php class BasicInformation extends Model { use SoftDeletes, HasFactory; protected $fillable = [ 'name', 'gender', 'dob', 'marital_status', 'profile_bio', 'user_id', 'children', 'children_living_status', 'profile_created_by', ]; protected $casts = [...
## TODO - [x] add formatter rules in biome config (referred https://github.com/7nohe/openapi-react-query-codegen/blob/main/biome.json#L21-L25) - [x] add linter script commands - [x] run linter:fix ## Code review Please see diff without whitespace...
# Summary - Introduce the sail option and execute the generate model command via sail. # Detail - If the sail flag is enabled, php artisan will be replaced with...