Skip to content

Commit 6b23d30

Browse files
Update to Laravel 8.x
1 parent 727e2c9 commit 6b23d30

File tree

7 files changed

+15
-9
lines changed

7 files changed

+15
-9
lines changed

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"homepage": "https://github.com/creativetimofficial/black-dashboard-laravel",
66
"keywords": ["Laravel", "Preset", "Black"],
77
"require": {
8-
"laravel/framework": "^7.0"
8+
"laravel/framework": "^8.0",
9+
"laravel/legacy-factories": "^1.0"
10+
911
},
1012
"autoload": {
1113
"psr-4": {

src/BlackPreset.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected static function updateAuthViews()
104104
// Add Auth routes in 'routes/web.php'
105105
file_put_contents(
106106
'./routes/web.php',
107-
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home')->middleware('auth');\n\n",
107+
"Auth::routes();\n\nRoute::get('/home', 'App\Http\Controllers\HomeController@index')->name('home')->middleware('auth');\n\n",
108108
FILE_APPEND
109109
);
110110

@@ -122,7 +122,7 @@ protected static function updateAuthViews()
122122
public static function addUserManagement()
123123
{
124124
// Add seeder, controllers, requests and rules
125-
static::copyDirectory('database/seeds', app_path('../database/seeds'));
125+
static::copyDirectory('database/seeds', app_path('../database/seeders'));
126126

127127
static::copyFile('app/Http/Controllers/UserController.php', app_path('Http/Controllers/UserController.php'));
128128
static::copyFile('app/Http/Controllers/ProfileController.php', app_path('Http/Controllers/ProfileController.php'));
@@ -132,7 +132,7 @@ public static function addUserManagement()
132132
// Add routes
133133
file_put_contents(
134134
'./routes/web.php',
135-
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'ProfileController@edit']);\n\tRoute::put('profile', ['as' => 'profile.update', 'uses' => 'ProfileController@update']);\n\tRoute::put('profile/password', ['as' => 'profile.password', 'uses' => 'ProfileController@password']);\n});\n\n",
135+
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']);\n\tRoute::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);\n\tRoute::put('profile/password', ['as' => 'profile.password', 'uses' => 'App\Http\Controllers\ProfileController@password']);\n});\n\n",
136136
FILE_APPEND
137137
);
138138

@@ -151,7 +151,7 @@ public static function addPagesViews()
151151
// Add routes
152152
file_put_contents(
153153
'./routes/web.php',
154-
"Route::group(['middleware' => 'auth'], function () {\n\t\tRoute::get('icons', ['as' => 'pages.icons', 'uses' => 'PageController@icons']);\n\t\tRoute::get('maps', ['as' => 'pages.maps', 'uses' => 'PageController@maps']);\n\t\tRoute::get('notifications', ['as' => 'pages.notifications', 'uses' => 'PageController@notifications']);\n\t\tRoute::get('rtl', ['as' => 'pages.rtl', 'uses' => 'PageController@rtl']);\n\t\tRoute::get('tables', ['as' => 'pages.tables', 'uses' => 'PageController@tables']);\n\t\tRoute::get('typography', ['as' => 'pages.typography', 'uses' => 'PageController@typography']);\n\t\tRoute::get('upgrade', ['as' => 'pages.upgrade', 'uses' => 'PageController@upgrade']);\n});\n\n",
154+
"Route::group(['middleware' => 'auth'], function () {\n\t\tRoute::get('icons', ['as' => 'pages.icons', 'uses' => 'App\Http\Controllers\PageController@icons']);\n\t\tRoute::get('maps', ['as' => 'pages.maps', 'uses' => 'App\Http\Controllers\PageController@maps']);\n\t\tRoute::get('notifications', ['as' => 'pages.notifications', 'uses' => 'App\Http\Controllers\PageController@notifications']);\n\t\tRoute::get('rtl', ['as' => 'pages.rtl', 'uses' => 'App\Http\Controllers\PageController@rtl']);\n\t\tRoute::get('tables', ['as' => 'pages.tables', 'uses' => 'App\Http\Controllers\PageController@tables']);\n\t\tRoute::get('typography', ['as' => 'pages.typography', 'uses' => 'App\Http\Controllers\PageController@typography']);\n\t\tRoute::get('upgrade', ['as' => 'pages.upgrade', 'uses' => 'App\Http\Controllers\PageController@upgrade']);\n});\n\n",
155155
FILE_APPEND
156156
);
157157

src/black-stubs/app/Http/Controllers/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Http\Controllers;
44

5-
use App\User;
5+
use App\Models\User;
66
use App\Http\Requests\UserRequest;
77
use Illuminate\Support\Facades\Hash;
88

@@ -11,7 +11,7 @@ class UserController extends Controller
1111
/**
1212
* Display a listing of the users
1313
*
14-
* @param \App\User $model
14+
* @param \App\Models\User $model
1515
* @return \Illuminate\View\View
1616
*/
1717
public function index(User $model)

src/black-stubs/app/Http/Requests/ProfileRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Http\Requests;
44

5-
use App\User;
5+
use App\Models\User;
66
use Illuminate\Validation\Rule;
77
use Illuminate\Foundation\Http\FormRequest;
88

src/black-stubs/app/Http/Requests/UserRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Http\Requests;
44

5-
use App\User;
5+
use App\Models\User;
66
use Illuminate\Validation\Rule;
77
use Illuminate\Foundation\Http\FormRequest;
88

src/black-stubs/database/seeds/DatabaseSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2+
namespace Database\Seeders;
23

4+
use Illuminate\Support\Facades\DB;
35
use Illuminate\Database\Seeder;
46

57
class DatabaseSeeder extends Seeder

src/black-stubs/database/seeds/UsersTableSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2+
namespace Database\Seeders;
23

4+
use Illuminate\Support\Facades\DB;
35
use Illuminate\Database\Seeder;
46
use Illuminate\Support\Facades\Hash;
57

0 commit comments

Comments
 (0)