当前位置: 首页>>代码示例>>PHP>>正文


PHP User::check方法代码示例

本文整理汇总了PHP中App\Model\User::check方法的典型用法代码示例。如果您正苦于以下问题:PHP User::check方法的具体用法?PHP User::check怎么用?PHP User::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Model\User的用法示例。


在下文中一共展示了User::check方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getLogin

 public function getLogin()
 {
     if (User::check()) {
         return redirect('/');
     }
     return view('user.login');
 }
开发者ID:xinray,项目名称:html-css,代码行数:7,代码来源:UserController.php

示例2: handle

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (User::check() == false) {
            if ($request->ajax() || $request->wantsJson()) {
                return API::error(['code' => 101, '' => '']);
            } else {
                return redirect()->guest('user/login');
            }
        }

        return $next($request);
    }
开发者ID:xinray,项目名称:html-css,代码行数:19,代码来源:UserMiddleware.php

示例3: function

|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    if (\App\Model\User::check() == false) {
        header('Location:login');
    } else {
        header('Location:home');
    }
    exit;
});
Route::get('login', function () {
    if (\App\Model\User::check()) {
        header('Location:home');
        exit;
    }
    /*App\User::create(array(
          'name' => 'Popea',
          'password' => Hash::make('Apparently')
      ));*/
    return view('login');
});
Route::post('login-act', ['as' => 'login-act', 'uses' => 'NewsController@loginAct']);
Route::get('home', ['as' => 'home', 'uses' => 'NewsController@showList']);
Route::get('subscribe/list', ['as' => 'subscribe', 'uses' => 'NewsController@subscribeList']);
Route::get('subscribe/add', ['as' => 'subscribe-add', 'uses' => 'NewsController@subscribeAdd']);
Route::get('special-site', ['as' => 'special-site', 'uses' => 'NewsController@specialSite']);
Route::post('subscribe/test', ['as' => 'subscribe-test', 'uses' => 'NewsController@subscribeTest']);
开发者ID:yisonvest,项目名称:popnews-ui,代码行数:31,代码来源:routes.php

示例4: beforeLogin

 private function beforeLogin()
 {
     if (\App\Model\User::check() == false) {
         header('Location:login');
         exit;
     }
 }
开发者ID:yisonvest,项目名称:popnews-ui,代码行数:7,代码来源:NewsController.php


注:本文中的App\Model\User::check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。