Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function share_index($page = '')
 {
     if (Input::get('class')) {
         $lifes = Article::with('cla')->orderBy('created_at', 'DESC')->where('classify', (int) Input::get('class'))->paginate(10)->setPath('share');
     } else {
         $classify = Classify::where('pid', '=', '2')->lists('id');
         $lifes = Article::with('cla')->orderBy('created_at', 'DESC')->whereIn('classify', $classify)->paginate(10)->setPath('share');
     }
     return view('home.life')->withLifes($lifes);
 }
Exemplo n.º 2
0
 public function getControlAttribute()
 {
     return Classify::where('id', $this->attributes['classify'])->get()[0]->control;
 }