If you want to fill a column automatically while you persist data to the database (e.g: slug) use Model Observer instead of hard code it every time
1use Illuminate\Support\Str; 2 3class Article extends Model 4{ 5 ... 6 protected static function boot() 7 { 8 parent:boot(); 9 10 static::saving(function ($model) {11 $model->slug = Str::slug($model->title);12 });13 }14}
Tip given by @sky_0xs