Download the PHP package mhasankn/dart-models without Composer
On this page you can find all versions of the php package mhasankn/dart-models. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mhasankn/dart-models
More information about mhasankn/dart-models
Files in mhasankn/dart-models
Package dart-models
Short Description Laravel library to easily generate models for Dart/Flutter from command line.
License MIT
Informations about the package dart-models
Laravel Dart Models
This package allows you to generate Dart/Flutter models directly from Laravel migrations or database schema. It simplifies the creation of strongly-typed Dart models by parsing your Laravel structure and generating code accordingly.
Features
- Generate models from Laravel migrations.
- Generate models from your database schema.
- Supports nullable fields and various Laravel column types.
- Provides JSON serialization methods for Dart models.
Installation
-
Add this package to your Laravel project via Composer:
- In your Laravel project, open config/app.php or bootstrap/providers.php and add the following entry to the providers array:
Usage
-
Generate models from migrations: bash Copy code php artisan dart:models --from-migrations This command will parse all migration files in your Laravel project and generate Dart models based on the table structure.
- Generate models from the database schema: bash Copy code php artisan dart:models --from-database This command connects to your Laravel database and generates Dart models based on the existing table schema.
Example Dart Model
Below is an example of a Dart model generated by the package:
This formatting ensures clarity and consistency for the users of your package. Let me know if further adjustments are needed!
Contributing
Feel free to open issues or submit PRs. Contributions are welcome!
License
This package is licensed under the MIT License. See LICENSE.md for details.