Ejemplo n.º 1
0
 /**
  * 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');
 }
Ejemplo n.º 2
0
 /**
  * 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');
 }
Ejemplo n.º 3
0
 /**
  * Show Marketing Page
  * @return view|redirect
  */
 public function marketing()
 {
     if (Auth::check()) {
         return redirect('home');
     }
     $userCount = User::count();
     return view('marketing', compact('userCount'));
 }
Ejemplo n.º 4
0
 /**
  * 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'])]);
 }
Ejemplo n.º 5
0
 /**
  * Create a new command instance.
  *
  * @return void
  */
 public function __construct($userId)
 {
     $this->user = User::findOrFail($userId);
 }
Ejemplo n.º 6
0
 /**
  * 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');
 }
Ejemplo n.º 7
0
 /**
  * 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}");
 }