/** * Register any other events for your application. * * @param \Illuminate\Contracts\Events\Dispatcher $events * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); //мои модели Song::saving(function ($songs) { $songs['user_id'] = Auth::user()->id; }); /*Song::deleting(function ($songs) { $path = 'media/upload/' . $songs->picture; if (file_exists($path)) { @unlink($path); } });*/ // }