Why I don't like soft delete
Updated: 15th September 2024Tags: laravel programming database opinion
There are few important differences:
# | Insert | Create |
---|---|---|
Respects fillable / guarded | No | Yes |
Creates timestamps | No | Yes |
Returns created object | No | Yes |
Runs booted method | No | Yes |
Allows multi insert | Yes | No |
If you changed superviser config, or add new program to it, you need to restart it.
sudo supervisorctl stop all
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start "laravel-worker:*"
php artisan about
It will show laravel version with bunch of other usefull information.
Add whole directory of your app to windows defender Exclusions. You can also move your projects in project directory and add projects to exclusion.
DB::enableQueryLog(); // Enable query log
// use orm
dd(DB::getQueryLog()); // Show results of log
Laravel queue job is caching your job php code, so after updating job code you need to:
php artisan queue:restart
$randomRow = DB::table('table')
->inRandomOrder()
->first();
$randomId = DB::table('table')
->inRandomOrder()
->value('id');
After installing laravel you MUST change some folder permissions.
sudo chmod 755 -R laravel_app
sudo chmod -R o+w laravel_app/storage
sudo chmod -R o+w laravel_app/bootstrap/cache