LoginSignup
0
0

More than 1 year has passed since last update.

セッション

Last updated at Posted at 2020-03-25
Request->session()->put('キー', 値);
$変数 = Request->session()->get('キー');

sessionの格納先は
storage/framework/sessionsになる。

データベースでセッションを使う

下記設定に変更する

config/session.php
'driver' => env('SESSION_DRIVER', 'database')
SESSION_DRIVER=database

コマンド実行

php artisan session:table

マイグレーションファイルが作成されるのでphp artisan migrateすればDBでセッションを扱えるようになる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0