Beispiel #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  $idOrSlug
  *
  * @return Response
  */
 public function edit($idOrSlug)
 {
     if (!Auth::hasPermission("update")) {
         return Redirect::back();
     }
     // get the news article
     $news = $this->news_service->findByIdOrSlug($idOrSlug);
     // get all writers
     $writers = $this->writers->all();
     // get timezones
     $timezones = Helper::getTimezones();
     return View::make("cms.pages.news.edit")->with('section', $this->section)->with('writers', $writers)->with('timezones', $timezones)->with('updating', true)->with('errors', Input::get('errors') ? Input::get('errors') : null)->with('edit_news', $news)->with('limited_editing', $this->content_service->isLimitedEditing($news));
 }
Beispiel #2
0
 /**
  * Format the date using carbon
  *
  * @param      $date
  * @param bool $instance
  *
  * @return mixed
  */
 protected function formatDate($date, $instance = false)
 {
     return Helper::formatDateUsingCarbon($date, $instance);
 }