public function index() { $artists = Artist::orderBy('name', 'ASC')->get(); foreach ($artists as $artist) { if ($artist->user_id != 0) { $userProfileSlug = User::where('id', $artist->user_id)->select('slug')->get(); $artist->profileLink = "/users/" . $userProfileSlug[0]->slug; } else { $artist->profileLink = "/artists/show/" . $artist->id; } } return View::make('artists/index', compact('artists')); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { view()->composer('*', function ($view) { $filterData = filter_optie::orderBy('naam')->get(); $artists = Artist::orderBy('name')->get(); $newarray = array(); foreach ($filterData as $filter) { $newarray[$filter->filter_id][$filter->naam] = $filter->naam; } view()->share(['newarray' => $newarray, 'artists' => $artists]); }); return $next($request); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Request $request, $id) { $concerts = Concert::orderBy('created_at', 'asc')->get(); $currentConcert = Concert::where('id', $id)->first(); $artists = Artist::orderBy('created_at', 'asc')->get(); $lieux = array(); foreach ($concerts as $concert) { if (!in_array($concert->lieu, $lieux)) { $lieux[] = $concert->lieu; } } return view('admin_edit', ['lieux' => $lieux, 'artists' => $artists, 'currentConcert' => $currentConcert]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $out['artists'] = Artist::orderBy('sort_name')->paginate(20); return view('artists.list', $out); }
/** * Show the form for editing the specified resource. * * @param string $slug * @return Response */ public function edit($slug) { // get the artwork $artwork = Artwork::where('slug', $slug)->first(); // Does the artwork exist? if ($artwork) { // Get the selectbox options and pass them to the view via the compact function. $artists = Artist::orderBy('name')->get(); $categories = filter_optie::where('filter_id', '=', 1)->where('id', '>', 5)->orderBy('naam')->get(); $genres = filter_optie::where('filter_id', '=', 2)->where('id', '>', 5)->orderBy('naam')->get(); $techniques = filter_optie::where('filter_id', '=', 3)->where('id', '>', 5)->orderBy('naam')->get(); $materials = filter_optie::where('filter_id', '=', 4)->where('id', '>', 5)->orderBy('naam')->get(); $colours = filter_optie::where('filter_id', '=', 5)->where('id', '>', 5)->orderBy('naam')->get(); $formats = array('Klein', 'Middelgroot', 'Groot'); $filterArray = ['artwork', 'artists', 'techniques', 'genres', 'materials', 'categories', 'formats', 'colours']; // Show the view return View::make('artworks/edit', compact($filterArray)); } else { // Show the not found page return View::make('errors/' . HttpCode::NotFound); } }