Download the PHP package triun/laravel-model-base without Composer
On this page you can find all versions of the php package triun/laravel-model-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-model-base
Laravel Model Base
Generate Eloquent Model Base for Laravel.
About
Laravel-Model-Base is a Laravel command to perform repetitive tasks while creating new models, and saving it into a abstract model base, so you can update it any time, without need to worry about overwriting your manual changes in the model.
The main goal of the model base it's generate eloquent configurations based on the database table architecture, meaning that it could not be any business logic implemented, or any other logic not comming from the database itself. If you are interested in adding extra properties, methods, interfaces or traits, you can do so in the model itself.
This generator can be customised by the config parameters, but it can also be extended by the modifiers.
The model will be optionally generated too, but in this case, it will never be able to be overwritten by this tool.
Installation
Require this package with composer using the following command:
After updating composer, add the service provider to the providers array in config/app.php
Development only installation
To install this package on only development systems, add the --dev
flag to your composer command:
Instead of adding the service provider in the config/app.php
file, you should add the following code to your app/Providers/AppServiceProvider.php
file, within the register()
method:
This will allow your application to load the Laravel Model Base on non-production environments.
Usage
To create one model base
For Bulk creation
Note: If you don't set up the connections in the config file (model-base.bulk.connections
),
it will try to run all available connections from your database config file (database.connections
).
Customize
You can publish the configuration file into your app with:
Lumen
If you are using Lumen, you may need to do some manual steps...
Copy the config file into your config
directory:
And you may also need to uncomment the following lines in bootstrap/app.php
file:
So we can use Facades and Eloquent, as well as add some content in the AppServiceProvider
:
// TODO
Besides the configuration file, you can also add or create your own modifiers.
Modifiers
If you want to add behaviours to the generator, you can do so using the skeleton modifiers.
Modifiers Packages
Those are some modifiers packages:
// TODO
Add modifiers
If you already have any modifier package, you can load it by adding it in the config/model-base.php
file, in the 'modifiers' array.
// TODO
Create your own modifiers
How to create a modifier.
// TODO
Documentation
The documentation for Laravel-Model-Base is available on the Github wiki.
Issues
Bug reports and feature requests can be submitted on the Github Issue Tracker.
Contributing
See CONTRIBUTING.md for information.
License
The Laravel Model Base is open-sourced software licensed under the MIT license
All versions of laravel-model-base with dependencies
illuminate/support Version ^9.0
illuminate/console Version ^9.0
illuminate/filesystem Version ^9.0
illuminate/database Version ^9.0
illuminate/config Version ^9.0
doctrine/dbal Version ^3.3
triun/diff Version ^1.0