/** * Execute the console command. * * @return mixed */ public function fire() { $this->info('Start fetching'); $this->user->hasDropboxToken()->hasImgurToken()->chunk(10, function ($users) { foreach ($users as $user) { $this->pushFetchImagesQueue($user); } }); $this->info('Done'); }
/** * Execute the console command. * * @return mixed */ public function handle() { $this->info('Start fetching'); $this->user->hasDropboxToken()->hasImgurToken()->chunk(10, function ($users) { foreach ($users as $user) { $this->dispatch((new FetchImages($user))->onQueue('low')); } }); $this->info('Done'); }
/** * Show Marketing Page * @return view|redirect */ public function marketing() { if (Auth::check()) { return redirect('home'); } $userCount = User::count(); return view('marketing', compact('userCount')); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['email' => $data['email'], 'password' => bcrypt($data['password'])]); }
/** * Create a new command instance. * * @return void */ public function __construct($userId) { $this->user = User::findOrFail($userId); }
/** * Handle register request * @param RegisterRequest $request * @return redirect */ public function registerHandle(RegisterRequest $request) { $password = Hash::make($request->get('password')); $user = User::create(['email' => $request->get('email'), 'password' => $password]); return redirect()->route('auth.login'); }
/** * 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}"); }