/** * Create a new command instance. * * @return void */ public function __construct($userId) { $this->user = User::findOrFail($userId); }
/** * Create a new command instance. * * @return void */ public function __construct($userId, $favoriteId) { $this->user = User::findOrFail($userId); $this->favorite = Cache::get("user:{$userId}:favorite:{$favoriteId}"); }