Skip to main content

Command Palette

Search for a command to run...

Improve Laravel development experience

Updated
1 min read
Improve Laravel development experience
R

Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference

Add it to the boot method of the AppServiceProvider of the app to improve Laravel developmet experience.

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class AppServiceProvider extends ServiceProvider
{
    //...

    public function boot(): void
    {
        Model::shouldBeStrict();
        Model::unguard();
        DB::prohibitDestructiveCommands(app()->isProduction());
        Date::use(CarbonImmutable::class);
    }
}