Session 任务调度中的会话
我需要在Laravel任务调度中获取会话。Session 任务调度中的会话,session,laravel-5,cron,laravel-5.5,Session,Laravel 5,Cron,Laravel 5.5,我需要在Laravel任务调度中获取会话。 下面是我的UserActivity类 <?php namespace App\Console\Commands; use Illuminate\Console\Command; class UserActivity extends Command { protected $signature = 'Example:test'; protected $description =
下面是我的UserActivity类
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class UserActivity extends Command
{
protected $signature = 'Example:test';
protected $description = 'testing';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$value = \Session::all();
\Log::alert($value);
}
}
没有会话,这是一个控制台命令。没有Http请求与可能与会话匹配的cookie一起进入。您无法通过laravel任务调度访问会话。