Package Data | |
---|---|
Maintainer Username: | FBNKCMaster |
Maintainer Contact: | FBNKCMaster@gmail.com (Farid BEN KACEM) |
Package Create Date: | 2016-07-03 |
Package Last Update: | 2016-07-06 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:09:26 |
Package Statistics | |
---|---|
Total Downloads: | 20 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
AppSkeleton for Laravel is a custom artisan command that helps you speed up your application development by generating a ready structure (based on a json file) of files and direcories you'll need for your app
$ composer require fbnkcmaster/appskeleton-for-laravel
This is done within the app/Console/Kernel.php
file, like so:
protected $commands = [
// add the line below to this array
\FBNKCMaster\AppSkeletonForLaravel\AppSkeletonCommand::class
];
app/Console/Kernel.php
file, like so:protected $commands = [
// add the line below to this array
path/to/where/you/put/AppSkeleton/AppSkeletonCommand::class
];
Optional
You will need to install Jeffrey Way's laracasts/generators for more advanced option with migrations.
Then add its service provider in app/Providers/AppServiceProvider.php, like so:
public function register()
{
if ($this->app->environment() == 'local') {
$this->app->register('Laracasts\Generators\GeneratorsServiceProvider');
}
}
You're ready now. Run php artisan
from the console, and you'll see the new command make:appskeleton
in the make:*
namespace section.
Put the json file whereever you can access it from the artisan command
{
"name": "App Name",
"routes": [
{"get": "/:function () {return view('welcome');}"},
{"get": "home:HomeControler@index"},
{"get": "users/{user}:UsersController@show"},
{"post": "post:PostsController@store"},
{"post": "comment:CommentsController@store"},
{"resource": "post:PostsController"},
{"resource": "comment:CommentsController"}
],
"controllers": [
{"name": "home"},
{"name": "dashboard"},
{"name": "users", "resource": false},
{"name": "posts", "resource": true},
{"name": "comments", "resource": true}
],
"models": [
{"name": "user"},
{"name": "post", "migration": false},
{"name": "comment", "migration": true}
],
"migrations": [ // Jeffrey Way's laracasts/generators needed to take care of this, otherwise the schema is ignored and it will generate simple migrations files
{"users_infos": "username:string, email:string:unique"},
{"posts": "id:integer:unique, title:string"},
{"comments": "id:integer:unique, post_id:integer:unique, text:string"}
],
"views": ["home", "dashboard", "pages.users", "pages.posts", "pages.comments"],
"assets": [
{"sass": ["file1.sass", "file2.sass", "partials/subfile1.sass"]},
{"js": ["file1.js", "file2.js", "plugins/file1.js", "plugins/file2.js"]}
],
"publics": ["folder1", "folder2", "folder2/subfolder1", "folder2/subfolder2"]
}
Generate everything in the json file (where AppSkeleton.json in the root of your Laravel application)
$ php artisan make:appskeleton
You can specify the path to your json file
$ php artisan make:appskeleton path/to/your/appskeleton_file.json
Genereate just Controllers and Views
$ php artisan make:appskeleton --controllers --views
Backup what was generated
$ php artisan make:appskeleton [--controllers] [--views] --backup
Delete what was generated
$ php artisan make:appskeleton [--controllers] [--views] --clear
Force delete generated files and directories even the backups
$ php artisan make:appskeleton [--controllers] [--views] --clear --f
path/to/file.json set the json file that contains the structure of the app
--routes parse routes
--controllers parse controllers
--models parse models
--migrations parse migrations
--views parse views
--assets parse assets
--publics parse publics
--routes parse routes
--b, --backup make backup of generated files
--c, --clear delete generated files
--f, --force force delete generated files even backups