/** * Fetches required variables for navigation */ public function composeNavigation() { view()->composer('partials.nav', function ($view) { $view->with('latest', Broadcast::latest()->first()); }); }
public function destroy($id) { $broadcast = Broadcast::whereId($id)->firstOrFail(); $broadcast->delete(); return redirect('/broadcast')->with('status', 'The broadcast ' . $broadcast->title . ' has been deleted!'); }
/** * @param Broadcast $broadcast * @param BroadcastRequest $request */ public function syncGenres(Broadcast $broadcast, array $tags) { $broadcast->genres()->sync($tags); }