本文整理汇总了PHP中Sentinel::getPersistenceRepository方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentinel::getPersistenceRepository方法的具体用法?PHP Sentinel::getPersistenceRepository怎么用?PHP Sentinel::getPersistenceRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentinel
的用法示例。
在下文中一共展示了Sentinel::getPersistenceRepository方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
Route::post('reset/{key}', 'UsersController@postResetPassword');
});
Route::group(['prefix' => 'sessions', 'as' => 'sessions'], function () {
Route::get('/', 'UsersController@showSessions');
Route::get('kill', function () {
$user = Sentinel::getUser();
Sentinel::getPersistenceRepository()->flush($user);
return Redirect::back();
});
Route::get('kill-all', function () {
$user = Sentinel::getUser();
Sentinel::getPersistenceRepository()->flush($user, false);
return Redirect::back();
});
Route::get('kill/{code}', function ($code) {
Sentinel::getPersistenceRepository()->remove($code);
return Redirect::back();
});
});
Route::group(['prefix' => 'posts', 'as' => 'posts'], function () {
Route::get('/', function () {
return Redirect::route('posts.list');
});
Route::group(['prefix' => 'list', 'as' => '.list'], function () {
Route::get('/', 'PostsController@index');
});
Route::get('create', 'PostsController@create')->name('.create');
Route::put('create', 'PostsController@store')->name('.store');
Route::put('create/reply', 'PostsController@storeComment')->name('.reply');
Route::get('{id}', 'PostsController@show')->name('.show');
Route::patch('{id}', 'PostsController@update')->name('.update');
示例2: flushAll
/**
* Flushes all sessions.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function flushAll()
{
Sentinel::getPersistenceRepository()->flush(Sentinel::getUser());
return Redirect::route('user.account');
}