public function show($bannerType) { $bannerType = Ref::findOrFail($bannerType); if ($bannerType->type != 'banner_type') { return redirect('/user/twitcher'); } $banners = BannerMapper::activeTwitcher($this->user, $bannerType->id); $requiredSizes = explode('*', $bannerType->title); return view('app.pages.user.twitcher.banner.show', compact('banners', 'bannerType', 'requiredSizes')); }
public function destroy($id) { $ref = Ref::findOrFail($id); if ($ref->children()->count() > 0) { return Redirect::back()->withErrors(['This ref has children and can not be removed.']); } $ref->delete(); return Redirect::back(); }