@@ -1,41 +1,41 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'items_to_generate' => [ |
|
4 | - 'Common' => [ |
|
5 | - 'Migration', |
|
6 | - 'Model', |
|
7 | - 'Seeder', |
|
8 | - 'Route' |
|
9 | - ], |
|
10 | - 'Frontend' => [ |
|
11 | - 'Controller', |
|
12 | - ], |
|
13 | - 'Backend' => [ |
|
14 | - 'Controller', |
|
15 | - 'Api', |
|
16 | - 'Request', |
|
17 | - 'View', |
|
18 | - 'Notification', |
|
19 | - 'Observer' |
|
20 | - ] |
|
21 | - ], |
|
22 | - 'files_to_publish' => [ |
|
3 | + 'items_to_generate' => [ |
|
4 | + 'Common' => [ |
|
5 | + 'Migration', |
|
6 | + 'Model', |
|
7 | + 'Seeder', |
|
8 | + 'Route' |
|
9 | + ], |
|
10 | + 'Frontend' => [ |
|
11 | + 'Controller', |
|
12 | + ], |
|
13 | + 'Backend' => [ |
|
14 | + 'Controller', |
|
15 | + 'Api', |
|
16 | + 'Request', |
|
17 | + 'View', |
|
18 | + 'Notification', |
|
19 | + 'Observer' |
|
20 | + ] |
|
21 | + ], |
|
22 | + 'files_to_publish' => [ |
|
23 | 23 | 'public', |
24 | 24 | 'app', |
25 | 25 | 'database', |
26 | 26 | 'resources', |
27 | - ], |
|
28 | - 'image_sizes' => [ |
|
29 | - 'sm' => '500x500', |
|
30 | - 'md' => '800x800', |
|
31 | - 'xs' => '200x200', |
|
32 | - ], |
|
33 | - 'events' => [ |
|
34 | - 'created','updated','deleted' |
|
35 | - ], |
|
36 | - 'seed_rows' => 25, |
|
37 | - 'listing_per_page' => 20, |
|
38 | - 'generic_fields' => true, |
|
39 | - 'seo_fields' => true, |
|
40 | - 'user_model' => 'App\User' |
|
27 | + ], |
|
28 | + 'image_sizes' => [ |
|
29 | + 'sm' => '500x500', |
|
30 | + 'md' => '800x800', |
|
31 | + 'xs' => '200x200', |
|
32 | + ], |
|
33 | + 'events' => [ |
|
34 | + 'created','updated','deleted' |
|
35 | + ], |
|
36 | + 'seed_rows' => 25, |
|
37 | + 'listing_per_page' => 20, |
|
38 | + 'generic_fields' => true, |
|
39 | + 'seo_fields' => true, |
|
40 | + 'user_model' => 'App\User' |
|
41 | 41 | ]; |
42 | 42 | \ No newline at end of file |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'xs' => '200x200', |
32 | 32 | ], |
33 | 33 | 'events' => [ |
34 | - 'created','updated','deleted' |
|
34 | + 'created', 'updated', 'deleted' |
|
35 | 35 | ], |
36 | 36 | 'seed_rows' => 25, |
37 | 37 | 'listing_per_page' => 20, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $bar->setOverwrite(true); |
55 | 55 | $bar->start(); |
56 | 56 | $fs = new FileSystem(); |
57 | - foreach ($this->filesToPublish as $src ) { |
|
57 | + foreach ($this->filesToPublish as $src) { |
|
58 | 58 | $fs->clone($src, '/'); |
59 | 59 | } |
60 | 60 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | $this->line("\n"); |
78 | 78 | |
79 | 79 | foreach ($generatedFiles as $key => $file) { |
80 | - \Log::info("Generated file: " . str_replace(base_path() . "\\", "", $file)); |
|
80 | + \Log::info("Generated file: ".str_replace(base_path()."\\", "", $file)); |
|
81 | 81 | } |
82 | - $this->info( (isset($key) ? ++$key : 0) . " files generated. Check log for details."); |
|
82 | + $this->info((isset($key) ? ++$key : 0)." files generated. Check log for details."); |
|
83 | 83 | $this->info("Cheers!!!"); |
84 | 84 | } |
85 | 85 | } |
@@ -24,15 +24,15 @@ |
||
24 | 24 | */ |
25 | 25 | public function handle() |
26 | 26 | { |
27 | - copy(__DIR__ . '/../../src/resources/stubs/RouteServiceProvider.stub', app_path('Providers/LaragenRouteServiceProvider.php')); |
|
27 | + copy(__DIR__.'/../../src/resources/stubs/RouteServiceProvider.stub', app_path('Providers/LaragenRouteServiceProvider.php')); |
|
28 | 28 | if (!is_dir('routes/backend')) { |
29 | 29 | @mkdir(base_path('routes/backend'), 0777, true); |
30 | - copy(__DIR__ . '/../../src/resources/stubs/Route.stub', base_path('routes/backend/web.php')); |
|
31 | - copy(__DIR__ . '/../../src/resources/stubs/Route.stub', base_path('routes/backend/auth.php')); |
|
30 | + copy(__DIR__.'/../../src/resources/stubs/Route.stub', base_path('routes/backend/web.php')); |
|
31 | + copy(__DIR__.'/../../src/resources/stubs/Route.stub', base_path('routes/backend/auth.php')); |
|
32 | 32 | } |
33 | 33 | if (!is_dir('routes/frontend')) { |
34 | 34 | @mkdir(base_path('routes/frontend'), 0777, true); |
35 | - copy(__DIR__ . '/../../src/resources/stubs/Route.stub', base_path('routes/frontend/web.php')); |
|
35 | + copy(__DIR__.'/../../src/resources/stubs/Route.stub', base_path('routes/frontend/web.php')); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | '--provider' => 'Prateekkarki\Laragen\LaragenServiceProvider' |
31 | 31 | ]); |
32 | 32 | |
33 | - Artisan::call('vendor:publish', [ |
|
33 | + Artisan::call('vendor:publish', [ |
|
34 | 34 | '--provider' => 'Spatie\Permission\PermissionServiceProvider' |
35 | 35 | ]); |
36 | 36 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->app->register(ImageServiceProvider::class); |
51 | 51 | AliasLoader::getInstance()->alias('Image', Image::class); |
52 | 52 | |
53 | - $this->app->singleton('laragen', function () { |
|
53 | + $this->app->singleton('laragen', function() { |
|
54 | 54 | return LaragenOptions::getInstance(); |
55 | 55 | }); |
56 | 56 |
@@ -70,10 +70,12 @@ |
||
70 | 70 | |
71 | 71 | $routeFile = app_path('Providers/LaragenRouteServiceProvider.php'); |
72 | 72 | $observerFile = app_path('Providers/LaragenObserverServiceProvider.php'); |
73 | - if (file_exists($routeFile)) |
|
74 | - $this->app->register("\App\Providers\LaragenRouteServiceProvider"); |
|
75 | - if (file_exists($observerFile)) |
|
76 | - $this->app->register("\App\Providers\LaragenObserverServiceProvider"); |
|
73 | + if (file_exists($routeFile)) { |
|
74 | + $this->app->register("\App\Providers\LaragenRouteServiceProvider"); |
|
75 | + } |
|
76 | + if (file_exists($observerFile)) { |
|
77 | + $this->app->register("\App\Providers\LaragenObserverServiceProvider"); |
|
78 | + } |
|
77 | 79 | } |
78 | 80 | /** |
79 | 81 | * To register laragen as first level command. E.g. laragen:generate |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('notifications', function (Blueprint $table) { |
|
16 | + Schema::create('notifications', function(Blueprint $table) { |
|
17 | 17 | $table->uuid('id')->primary(); |
18 | 18 | $table->string('type'); |
19 | 19 | $table->morphs('notifiable'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
16 | + Schema::create('failed_jobs', function(Blueprint $table) { |
|
17 | 17 | $table->bigIncrements('id'); |
18 | 18 | $table->text('connection'); |
19 | 19 | $table->text('queue'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('jobs', function (Blueprint $table) { |
|
16 | + Schema::create('jobs', function(Blueprint $table) { |
|
17 | 17 | $table->bigIncrements('id'); |
18 | 18 | $table->string('queue')->index(); |
19 | 19 | $table->longText('payload'); |
@@ -6,17 +6,17 @@ |
||
6 | 6 | |
7 | 7 | class AlterUsersTable extends Migration |
8 | 8 | { |
9 | - public function up() |
|
10 | - { |
|
11 | - Schema::table('users', function (Blueprint $table) { |
|
12 | - $table->string('api_token', 60)->unique()->nullable(); |
|
13 | - }); |
|
14 | - } |
|
9 | + public function up() |
|
10 | + { |
|
11 | + Schema::table('users', function (Blueprint $table) { |
|
12 | + $table->string('api_token', 60)->unique()->nullable(); |
|
13 | + }); |
|
14 | + } |
|
15 | 15 | |
16 | - public function down() |
|
17 | - { |
|
18 | - Schema::table('users', function (Blueprint $table) { |
|
19 | - $table->dropColumn(['api_token']); |
|
20 | - }); |
|
21 | - } |
|
16 | + public function down() |
|
17 | + { |
|
18 | + Schema::table('users', function (Blueprint $table) { |
|
19 | + $table->dropColumn(['api_token']); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | } |
@@ -8,14 +8,14 @@ |
||
8 | 8 | { |
9 | 9 | public function up() |
10 | 10 | { |
11 | - Schema::table('users', function (Blueprint $table) { |
|
11 | + Schema::table('users', function(Blueprint $table) { |
|
12 | 12 | $table->string('api_token', 60)->unique()->nullable(); |
13 | 13 | }); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function down() |
17 | 17 | { |
18 | - Schema::table('users', function (Blueprint $table) { |
|
18 | + Schema::table('users', function(Blueprint $table) { |
|
19 | 19 | $table->dropColumn(['api_token']); |
20 | 20 | }); |
21 | 21 | } |
@@ -14,18 +14,18 @@ |
||
14 | 14 | */ |
15 | 15 | public function run() |
16 | 16 | { |
17 | - $email = '[email protected]'; |
|
18 | - $pass = Hash::make('password'); |
|
17 | + $email = '[email protected]'; |
|
18 | + $pass = Hash::make('password'); |
|
19 | 19 | |
20 | - $user = User::where('email', '=', $email)->first(); |
|
21 | - if ($user === null) { |
|
22 | - $user = new App\User(); |
|
23 | - $user->password = $pass; |
|
24 | - $user->email = $email; |
|
25 | - $user->email_verified_at = now(); |
|
26 | - $user->remember_token = Str::random(10); |
|
27 | - $user->name = 'Admin User'; |
|
28 | - $user->save(); |
|
29 | - } |
|
20 | + $user = User::where('email', '=', $email)->first(); |
|
21 | + if ($user === null) { |
|
22 | + $user = new App\User(); |
|
23 | + $user->password = $pass; |
|
24 | + $user->email = $email; |
|
25 | + $user->email_verified_at = now(); |
|
26 | + $user->remember_token = Str::random(10); |
|
27 | + $user->name = 'Admin User'; |
|
28 | + $user->save(); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | } |