Exemplo n.º 1
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         ShippingIntegrationController::checkTrackingNumbers();
     })->everyMinute();
     $schedule->call(function () {
         Log::info('In cron job');
         $now = Carbon::now();
         if (Campaign::where('status', 0)->where('scheduled_at', '<', $now)->count() > 0) {
             $campaigns = Campaign::where('status', 0)->where('scheduled_at', '<', $now)->get();
             foreach ($campaigns as $campaign) {
                 $campaign->doSendAll();
             }
         }
     })->everyMinute();
 }
Exemplo n.º 2
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use Illuminate\Http\Request;
use App\Http\Controllers\ShippingIntegrationController;
Route::get('shipping_test', function () {
    ShippingIntegrationController::checkTrackingNumbers();
});
Route::group(['middleware' => 'guest'], function () {
    Route::get('/', 'LoginController@showLogin');
    Route::post('/', 'LoginController@doLogin');
});
Route::group(['middleware' => 'auth'], function () {
    Route::get('dashboard', 'DashboardController@showDashboard');
    Route::get('dashboard/add-day', 'DashboardController@doAddDay');
    Route::get('dashboard/minus-day', 'DashboardController@doMinusDay');
    Route::get('dashboard/minus-dentist', 'DashboardController@doMinusDentist');
    Route::get('dashboard/add-dentist', 'DashboardController@doAddDentist');
    Route::get('dashboard/add-month', 'DashboardController@doAddMonth');
    Route::get('dashboard/minus-month', 'DashboardController@doMinusMonth');
    Route::get('dashboard/minus-week', 'DashboardController@doMinusWeek');
    Route::get('dashboard/add-week', 'DashboardController@doAddWeek');