예제 #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);
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $classify = Classify::find($id);
     $classify->delete();
     return Redirect::to('Today/classify');
 }
예제 #3
0
 public function getControlAttribute()
 {
     return Classify::where('id', $this->attributes['classify'])->get()[0]->control;
 }
예제 #4
0
 public function get_delete_classify($id)
 {
     $classify = Classify::findOrFail($id);
     $classify->delete();
     return Redirect::to('admin/classify_operate')->withErros(Null);
 }
예제 #5
0
//Route::get('auth/logout', 'Auth\AuthController@getLogout');
Route::group(['prefix' => '/', 'namespace' => 'Home'], function () {
    View::share('lables', Lable::all());
    View::share('comart', Article::comart());
    Route::get('/', 'HomeController@index');
    Route::get('lable/{id}', 'HomeController@lableArticle');
    Route::get('about', 'AboutController@index');
    Route::get('life/{page?}', 'LifeController@index');
    Route::get('life/show/{id}', 'LifeController@show');
    Route::get('study/{page?}', 'LifeController@study_index');
    Route::get('study/show/{id}', 'LifeController@show');
    Route::get('share/{page?}', 'LifeController@share_index');
    Route::get('share/show/{id}', 'LifeController@show');
    Route::get('time/{page?}', 'TimeController@index');
    Route::get('book', 'BookController@index');
});
Route::group(['prefix' => 'Today', 'namespace' => 'Today', 'middleware' => 'auth'], function () {
    View::share('lables', Lable::all());
    View::share('classify', Classify::all());
    Route::resource('/', 'AdminController@index');
    Route::resource('user', 'UserController');
    Route::resource('about', 'AboutController');
    Route::resource('article', 'ArticleController');
    Route::get('recommend/{id}', 'ArticleController@recommend');
    Route::get('showIndex/{id}', 'ArticleController@showIndex');
    Route::resource('time', 'TimeController');
    Route::resource('share', 'ShareController');
    Route::resource('book', 'BookController');
    Route::resource('lable', 'LableController');
    Route::resource('classify', 'ClassifyController');
});
예제 #6
0
 public function publish()
 {
     return view('admin/Page/publish')->withClassifys(Classify::All());
 }