Beispiel #1
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     // Sanitize the permalink
     $this->permalinkTrait($this->request['permalink']);
     // Create Correct Date and Time Format
     $this->setCreatedAtTime($this->request['date'], $this->request['time']);
     // Renames Directory name if permalink changes
     $this->renameDirectory($this->request['permalink'], $this->notice->permalink);
     // Update the notice
     $this->notice->update($this->request);
     // Update notice Tags
     if (isset($this->request['tag_list'])) {
         $this->notice->tags()->sync($this->request['tag_list']);
     } else {
         $this->notice->tags()->sync([]);
     }
     event(new SavedNotice($this->notice, 'updated'));
 }
Beispiel #2
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     // Change spaces to dashes and lowecase the value
     $this->permalinkTrait($this->request['permalink']);
     // Create Notice
     $notice = Notice::create($this->request);
     // Adds tags to post
     if ($this->tags && $this->tags != []) {
         $post->tags()->sync($this->tags);
     }
     // Fire the SavedPost Event and Listeners
     event(new SavedNotice($notice, 'created'));
 }
 /**
  * Display the news sitemap
  *
  * @return \Illuminate\Http\Response
  */
 public function news()
 {
     $news = Notice::orderBy('created_at', 'desc')->select(['created_at', 'permalink'])->get();
     return Response::view('public/sitemap/news', ['news' => $news], 200, ['Content-Type' => 'text/xml; charset=UTF-8']);
 }
Beispiel #4
0
 /**
  * Remove the specified release from storage
  * and images and directory too
  *
  * @param  int       $id
  * @param  Image     $image
  * @param  Directory $directory
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $this->dispatch(new DeleteNotice(Notice::findNoticeForDelete($id)->first()));
     return redirect()->route('admin.news.index');
 }
Beispiel #5
0
 /**
  * Get news for feeds
  * 
  * @return Response XML
  */
 public function news()
 {
     $data['news'] = Notice::newsFeeds();
     return Response::view('public/feeds/news', $data, 200, ['Content-Type' => 'application/atom+xml; charset=UTF-8']);
 }
 /**
  * Display notice details
  * 
  * @param  Request $request
  * @return Response
  */
 public function noticeDetails(Request $request, $permalink)
 {
     $variables = ['page' => 'news', 'path' => $request->segments(), 'categories' => Category::NewsCategories(), 'tags' => Tag::NewsTags(), 'notice' => Notice::NoticeDetails($permalink), 'sponsors' => Sponsor::PublicSponsors()];
     return view('public.news.notice-details', $variables);
 }