Example #1
0
 /**
  * View a post.
  *
  * @param  string  $slug
  * @return View
  * @throws NotFoundHttpException
  */
 public function getView($slug)
 {
     // Get this blog post data
     $client = ClientMetadata::where('key', '=', 'slug')->where('value', '=', $slug)->first()->client()->first();
     //var_dump($client);die;
     // Check if the blog post exists
     if (is_null($client)) {
         // If we ended up in here, it means that
         // a page or a blog post didn't exist.
         // So, this means that it is time for
         // 404 error page.
         return Client::abort(404);
     }
     // Show the page
     return View::make('site/clients/view_client', compact('client'));
 }