本文整理匯總了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');
}