/**
  * display all videos from a particular category
  * @param $id
  * @return \Illuminate\Http\Response
  */
 public function feedsByCategory($id)
 {
     $videos = Video::where('category_id', '=', $id)->get();
     $format = Carbon::now()->subMonth();
     $latest = $this->video->whereDateFormat('created_at', '>=', $format);
     return view('pages.categoryfeeds', compact('videos', 'latest'));
 }
Esempio n. 2
0
 public function testUserCanUpdateVideo()
 {
     $user = factory(\Techademia\User::class)->create();
     $this->actingAs($user)->withSession(['username' => 'jeffrey']);
     factory(\Techademia\Category::class)->create();
     factory(\Techademia\Video::class)->create();
     Video::where('id', 1)->update(['title' => 'new title']);
     $this->seeInDatabase('videos', ['title' => 'new title']);
     $this->visit('/video/1/edit')->seePageIs('/video/1/edit');
 }
 /**
  * 
  * 
  * @return [type] [description]
  */
 public function where($key, $val)
 {
     return Video::where($key, $val)->get();
 }