Download the PHP package onesite/laravel-module without Composer
On this page you can find all versions of the php package onesite/laravel-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onesite/laravel-module
More information about onesite/laravel-module
Files in onesite/laravel-module
Package laravel-module
Short Description Generate a module with model, migration, controller, routes and factory
License MIT
Informations about the package laravel-module
Laravel artisan make:resource command
This package adds the , allowing you to:
Generate a module create a model, migration, controller, routes and model factory in a single easy to use command.
This package serves as a way of very quickly getting an idea off the ground, reducing the time you need to spend setting up various parts of your application so that you can concentrate on the complexity.
Installation
Install MakeResource through Composer.
"require": {
"onesite/laravel-module": "~1.0"
}
Next, update your to add the included service provider :
'providers' => [
//...
\OneSite\Module\ModuleGeneratorServiceProvider::class
],
And you're good to go.
Using the generator
From the command line, run:
php artisan make:module ModelName "attributes"
For the simplest example, let's create a new module:
php artisan make:module admin
This will create the following:
- modules\Admin\app\Http\Controllers\BaseController.php
- modules\Admin\app\Http\Controllers\ExampleController.php
- modules\Admin\resources\views/example.blade.php
as well as appending to:
- modules\Admin\routes.php
Copy to composer.json and run to register composer for module, example with module :
"autoload": {
"psr-4": {
"Module\\Admin\\": [
"modules/admin/app/"
]
}
}
Next, update your to add the included service provider to your function:
public function register()
{
$this->app->register(\Modules\ModuleName\Providers\AppServiceProvider::class);
}
Running tests
A full test suite is included. To execute the tests, from the package directory:
vendor/bin/phpunit tests/testMakeNewModule.php
All versions of laravel-module with dependencies
illuminate/support Version ^7.0
illuminate/console Version ^7.0
illuminate/filesystem Version ^7.0
illuminate/events Version ^7.0
illuminate/routing Version ^7.0
illuminate/view Version ^7.0
illuminate/queue Version ^7.0
illuminate/contracts Version ^7.0
illuminate/config Version ^7.0
hashids/hashids Version ^3.0
firebase/php-jwt Version ^5.0