Exemple #1
1
 public function randomQuote()
 {
     try {
         return Inspiring::quote();
     } catch (\Exception $e) {
         return $e->getMessage();
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
     $this->info('info message');
     $this->comment('comment');
     $this->question('question');
     $this->error('error');
 }
Exemple #3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
     $this->table(['Name', 'Nickname'], [['Joshua', 'Jay Rock', 'may Day'], ['Lindsay', 'Hapagagwi'], ['Bellariz', 'Bhola'], ['Raymond', 'Mondi']]);
     $this->info("That's for sure. We all know J rock");
     $question = 'Are you sure you know who rock?';
     $choices = ['Joshua', 'Bradshaw', 'Matikinye'];
     $this->choice($question, $choices);
 }
 public function queueTest()
 {
     $Collection = \Illuminate\Support\Collection::make(['0 . ', '1 . ', '2 . ', '3 . ', '4 . ']);
     foreach (range(0, 2) as $v) {
         $message = \Illuminate\Foundation\Inspiring::quote();
         $job = (new \App\Jobs\PushMessage(1, $Collection->get($v)))->delay(20 * $v);
         \Bus::dispatch($job);
     }
     $job = (new \App\Jobs\PushMessage(1, $Collection->get(3), 1))->delay(20 * ($v + 1));
     \Bus::dispatch($job);
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
     $auctions = Art::where('art.end_datetime', '<', Carbon::now())->where('art.processed', '0')->get();
     // $test = $test;
     foreach ($auctions as $art) {
         $bids = $art->bids()->orderBy('price', 'DESC')->get();
         // var_dump($bids);
         if (count($bids)) {
             $winner = $bids->first();
             // var_dump($winner);
             $allMails = [];
             array_push($allMails, $winner->user->email);
             $loserMails = [];
             foreach ($bids as $bid) {
                 $email = $bid->user->email;
                 // echo $email;
                 if (!in_array($email, $allMails)) {
                     array_push($allMails, $email);
                     array_push($loserMails, $email);
                 }
             }
             $data = [];
             $data['winner'] = $winner->user;
             $data['auction-name'] = $art->title;
             Mail::send('emails.auction-win', $data, function ($message) use($data) {
                 $message->to($data['winner']->email)->subject('U heeft de auction gewonnen');
             });
             foreach ($loserMails as $mail) {
                 $data['mail'] = $mail;
                 Mail::send('emails.auction-lose', $data, function ($message) use($data) {
                     $message->to($data['mail'])->subject('U heeft de auction niet gewonnen');
                 });
             }
             $art->sold = 1;
         }
         $art->processed = 1;
         $art->save();
         echo $art->title . "\n";
     }
 }
 public function update(Request $request)
 {
     $result = 'Scheduled update.';
     $payload = json_decode($request->getContent(), true);
     switch ($request->header('x-github-event')) {
         case 'push':
             $this->dispatch(new UpdateProviders($payload['commits']));
             break;
         case 'pull_request':
             if ($payload['action'] == 'closed' && $payload['merged']) {
                 $this->dispatch(new UpdateProviders($payload['commits']));
                 break;
             }
             $result = 'No merge happened. Nothing to do.';
             break;
         case 'ping':
         default:
             $result = Inspiring::quote();
             break;
     }
     return response()->json(compact('result'));
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $rootPath = $this->getRootPath();
     $sourcePath = $this->getSourcePath();
     // Start Copying Files
     copy($sourcePath . 'aliases', $rootPath . 'aliases');
     copy($sourcePath . 'Homestead.yaml', $rootPath . 'Homestead.yaml');
     copy($sourcePath . 'Vagrantfile', $rootPath . 'Vagrantfile');
     if (!file_exists($rootPath . 'scripts')) {
         mkdir($rootPath . 'scripts');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'after.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'after.sh');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'blackfire.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'blackfire.sh');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'create-mysql.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'create-mysql.sh');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'create-postgres.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'create-postgres.sh');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'serve.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'serve.sh');
         copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'serve-hhvm.sh', $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'serve-hhvm.sh');
         $string = Inspiring::quote();
         $pieces = explode(' ', $string);
         $vbName = strtolower(array_pop($pieces));
         if ($this->option('name')) {
             $vbName = $this->option('name');
         }
         // Update virtualbox name
         $file = file_get_contents($rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb');
         $newFile = str_replace("vb.name = 'homestead'", "vb.name = '" . $vbName . "'", $file);
         if ($this->option('hostname')) {
             $hostName = $this->option('hostname');
             $newFile = str_replace("settings[\"hostname\"] ||= \"homestead\"", "settings[\"hostname\"] ||= \"" . $hostName . "\"", $file);
         }
         file_put_contents($rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb', $newFile);
     } else {
         $this->error('The scripts/ folder exists, please delete and run php artisan homeastead:create again.');
         die;
     }
     $this->info('Files Copied');
     $this->info('Ready to edit Homestead.yaml!');
 }
Exemple #8
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
 }
Exemple #9
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
     \Log::info('This is some useful information.');
 }
Exemple #10
0
<?php

use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
});
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL . \Carbon\Carbon::now());
 }
Exemple #12
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(Inspiring::quote());
 }
 public function getQuote()
 {
     return Inspiring::quote();
 }
Exemple #14
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*    $a=new Inspiring ;*/
     return view('welcome')->with('quote', Inspiring::quote());
 }