- Updating Laravel 7 to Laravel 8
- Note: Minimum PHP version is now 7.3+
Following the Laravel 8 Upgrade Guide
- The package is not compatible with Laravel 8 and the package is not maintained anymore
- Deleted config/analytics.php (No longer required)
- Removed the Provider from config/app.php
We manually added the js code to the view and its available by activating it on the admin panel.
According to the Laravel 8 Upgrade Guide, the namespace of the seeder and factory classes has changed.
- Changed the folder
database/seeds
todatabase/seeders
- Added namespace
Database\Seeders
to all the seeder Classes - Added namespace
Database\Factories
to all the factory Classes - Changed in
composer.json
file, removed classmap block from the autoload section and added the new namespaced class directory mappings in the psr-4 block - Updated
UserFactory
with the new structure (https://laravel.com/docs/8.x/database-testing#defining-model-factories)
- Maintenantce mode update: Changed in
public/index.php
. Read more at: https://laravel.com/docs/8.x/upgrade#maintenance-mode-updates.
- Changed in config/queue.php, "the
failed.driver
configuration option within yourqueue
configuration file should be updated todatabase-uuids
" - Created new migration file for failed_jobs table with uuids and updated the failed_jobs table with the new structure
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
(to...)
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
- Starting from Laravel 8, RouteServiceProvider the property
$namespace
is now null by default. This allows your controller route declarations to use the standard PHP callable syntax, which provides better support for jumping to the controller class in many IDEs:
use App\Http\Controllers\UserController;
// Using PHP callable syntax...
Route::get('/users', [UserController::class, 'index']);
// Using string syntax...
Route::get('/users', 'App\Http\Controllers\UserController@index');
- Changed all the routes to use the PHP callable syntax, in routes/web.php and routes/api.php.
- Set
null
the parameter$namespace
from the constructor of the RouteServiceProvider class.
// TODO
https://laravel.com/docs/8.x/upgrade#automatic-controller-namespace-prefixing
- Removed the package from composer.json because it dropped support.
- Installed the new package
fakerphp/faker
and updated the code to use the new namespace. - Nothing should change in the code because it uses the same namespace.