Приложение Laravel 5.3 \ Console \ Commdans \ AwesomeCommand | Uncaught ReflectionException

Я знаю, что есть много вопросов о ReflectionException.

Да, я пытался: composer dump-autoload
Я также сделал: artisan admin:clear
admin: clear, сделайте это:

public function handle()
{
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('view:clear');
Artisan::call('route:clear');
}

И я сделал копию / вставку класса, чтобы убедиться, что они одинаковы.

Когда я комментирую новую команду, все работает нормально. Итак, проблема действительно в этой новой команде.

Теперь код:

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\SendUlogs::class,
Commands\ClientPriority::class,
Commands\SmsBasic::class,
Commands\AdminClear::class,
Commands\CheckIps::class,
Commdans\AdminYesterday::class,
];

/**
* Define the application's command schedule.
*
* @param  \Illuminate\Console\Scheduling\Schedule  $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('oneaction:priority')
->hourly();
$schedule->command('ips:verify')
->dailyAt('8:00');
$schedule->command('ips:verify')
->dailyAt('10:00');
}

/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
}

Как я уже говорил, когда я делаю это:

protected $commands = [
Commands\SendUlogs::class,
Commands\ClientPriority::class,
Commands\SmsBasic::class,
Commands\AdminClear::class,
Commands\CheckIps::class,
//Commdans\AdminYesterday::class,
];

Все работает. Теперь код новой команды:

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Carbon;
use Messaging;
use App\CompUltime;
use App\CompElite;
use App\CompSimple;
use App\CompSubvsbank;
use App\CompAmortissement;
use App\CompBonifie;
use App\Client;
use App\Ip;
use App\User;

class AdminYesterday extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'admin:yesterday';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Send result of yesterday by sms.';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$start = Carbon::yesterday()->startOfDay();
$end = $start->copy()->endOfDay();
$countSimple = CompSimple::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$countElite = CompElite::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$countUltime = CompUltime::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$countBonifie = CompBonifie::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$countAmortissement = CompAmortissement::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$countSubvsbank = CompSubvsbank::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();
$clients = Client::where('created_at', '>=', $start)->where('created_at', '<=', $end)->count();

$comps = $countSimple+$countElite+$countUltime+$countBonifie+$countAmortissement+$countSubvsbank;

$admins = User::where('is_admin', 1)->get();
foreach ($admins as $admin) {
Messaging::msg(printView(view('sms.admin.register')->with('contact', $contact)))->to('1'.$admin->username)->sendMessage();
}
}
}

Я попытался удалить дескриптор и посмотреть, не было ли это из-за ошибки в коде. Я не работал.

Итак, что мне не хватает?

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector