mardi 22 septembre 2015

How to call controller's(method) from kernal.php in (scheduler) laravel5

controller file

namespace App\Http\Controllers;
use App\Repositories\CampaignpostRepository;
use App\Models\User;
use Illuminate\Exception\Handler;
use DB;
class CampaignpostController extends Controller {

 protected $campaign_gestion;
    /**
     * Store a new user.
     *
     * @param  Request  $request
     * @return Response
     */
 public function __construct(
  CampaignpostRepository $campaign_gestion)
 {
  $this->campaign_gestion = $campaign_gestion;
 }
    public function index()
    {
}

kernal.php

protected function schedule(Schedule $schedule)
 {
//  $schedule->command('inspire')
//     ->hourly();
                $schedule->command('CampaignpostController@index')->everyMinute();
 }

i need to call CampaignpostController from kernal.php how to call CampaignpostController.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire