Skip to content

Commit b764cf1

Browse files
Update Laravel 8.x
1 parent f92bf4f commit b764cf1

File tree

9 files changed

+16
-10
lines changed

9 files changed

+16
-10
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/now-ui-dashboard-laravel",
66
"keywords": ["Laravel", "Preset", "Now UI"],
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/NowUiPreset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected static function updateAuthViews()
106106
// Add Auth routes in 'routes/web.php'
107107
file_put_contents(
108108
'./routes/web.php',
109-
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n",
109+
"Auth::routes();\n\nRoute::get('/home', 'App\Http\Controllers\HomeController@index')->name('home');\n\n",
110110
FILE_APPEND
111111
);
112112

@@ -126,7 +126,7 @@ public static function addAlerts()
126126
public static function addUserManagement()
127127
{
128128
// Add seeder, controllers, requests and rules
129-
static::copyDirectory('database/seeds', app_path('../database/seeds'));
129+
static::copyDirectory('database/seeds', app_path('../database/seeders'));
130130
static::copyDirectory('database/factories', app_path('../database/factories'));
131131

132132
static::copyFile('app/Http/Controllers/UserController.php', app_path('Http/Controllers/UserController.php'));
@@ -137,7 +137,7 @@ public static function addUserManagement()
137137
// Add routes
138138
file_put_contents(
139139
'./routes/web.php',
140-
"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\tRoute::get('{page}', ['as' => 'page.index', 'uses' => 'PageController@index']);\n});\n\n",
140+
"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\tRoute::get('{page}', ['as' => 'page.index', 'uses' => 'App\Http\Controllers\PageController@index']);\n});\n\n",
141141
FILE_APPEND
142142
);
143143

src/now-ui-stubs/app/Http/Controllers/ProfileController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Http\Controllers;
44

55
use Gate;
6-
use App\User;
6+
use App\Models\User;
77
use Illuminate\Support\Facades\Hash;
88
use App\Http\Requests\ProfileRequest;
99
use App\Http\Requests\PasswordRequest;

src/now-ui-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/now-ui-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/now-ui-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/now-ui-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/now-ui-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

src/now-ui-stubs/resources/views/alerts/migrations_check.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if (!\Schema::hasTable((new \App\User)->getTable()))
1+
@if (!\Schema::hasTable((new \App\Models\User)->getTable()))
22
<div class="alert alert-danger fade show" role="alert">
33
{{ __('You did not run the migrations and seeders! The login information will not be available!') }}
44
</div>

0 commit comments

Comments
 (0)