0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have 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')
.env
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?