| Package Data | |
|---|---|
| Maintainer Username: | frdteknikelektro |
| Package Create Date: | 2019-06-08 |
| Package Last Update: | 2019-06-08 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-03 15:20:24 |
| Package Statistics | |
|---|---|
| Total Downloads: | 12 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 2 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 1 |
Edit composer.json
{
"require": {
"atnic/lumen-generator": "^0.1"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
}
}
Then run composer update. After that do this initial steps:
.env file.app/User.php, add api_token in $hidden property.bootstrap/app.php, uncomment and add some lines
...
$app->withFacades();
$app->withEloquent();
...
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
...
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);
$app->register(Atnic\LumenGenerator\Providers\AppServiceProvider::class);
$app->register(Atnic\LumenGenerator\Providers\ConsoleServiceProvider::class);
$app->register(Laravel\Passport\PassportServiceProvider::class);
...
database/factories/ModelFactory.php, add password and api_token
$factory->define(App\User::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->email,
'password' => app('hash')->make('password'),
'api_token' => str_random()
];
});
.gitignore
/database/*.sqlite
/storage/*.key
phpunit.xml, remove attribute syntaxCheck="false" if exists (ex: Lumen 5.5), because its not compatible with new phpunit packagephp artisan app:install
This package is overriding some laravel artisan command.
This is example to make Foo module in this project
php artisan make:controller --model=Foo FooController
Then do this steps:
database/migrations/, add column needed.database/factories/, add atrribute needed.app/, add changes needed.app/Filters/, do all TODO: and remove the comment if done.resources/lang/en and copy from en to lang id resources/lang/id, add language as needed.app/Http/Controllers/, complete returned array in method relations() visibles() fields() rules(), do all TODO:, and remove comment if done.app/Policies/, do all TODO: and remove the comment if done.$policies attribute in app/Providers/AuthServiceProvider.php. This package handle policy auto discovery, even for Laravel < 5.8.tests/Feature/, do all TODO: and remove the comment if done.# Creating Nested Controller
php artisan make:controller --parent=Foo --model=Bar Foo/BarController
# Create Single Action Controller
php artisan make:controller DashboardController
All new/overrided command can be viewed in vendor/atnic/lumen-generator/app/Console/Commands.