1

I don't know how to maintain and work with sessions. As I am a newbie in Laravel 4.

I have created a table as follows:

class Sessions extends Migration 
{
Schema::create('sessions', function($table)
{
    $table->string('id')->unique();
    $table->text('payload');
    $table->integer('last_activity');
});
}

Is this correct?

4

1 回答 1

5

步骤1:php artisan session:table

第2步:composer dump-autoload

第 3 步:php artisan migrate

如果您在 laravel 应用程序上设置了多个环境,那么

php artisan migrate --env=ENVIRONMENT_NAME

第 4 步:将默认驱动程序更改/app/config/session.php

'driver'=>'database',

如果您在 L4 应用程序上配置了多个数据库,则在 /app/config/session.php

'connection'=>CONNECTION_NAME
于 2013-08-12T07:49:48.723 回答