コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['link' => 'required', 'notify_by' => 'required']);
     $data = $request->only(['link', 'notify_by']);
     $data['type'] = FeedService::type($data['link']);
     $feed = Feeds::create($data);
     $this->currentUser()->feeds()->save($feed);
     $feed->checkNow();
     flash()->success('You\'ve added a feed for us to monitor');
     return redirect('/dashboard');
 }
コード例 #2
0
ファイル: Feeds.php プロジェクト: robbiepaul/postcheck
 public function checkNow()
 {
     $service = FeedService::get($this);
     try {
         $post = $service->getMostRecentPost();
         $last_id = $service->getId($post);
         $this->last_checked_id = $last_id;
         $this->last_checked_at = date('Y-m-d H:i:s');
         $this->save();
     } catch (\Exception $e) {
         dd($e);
     }
 }