mercredi 18 juillet 2018

Laravel : ошибка в миграции при вызове сидера

Всем привет! Подскажите почему при выполнении миграции Получаю ошибку:

  Class updateStorageSpaceLogsStatusLabel does not exist

?

в файле : database/migrations/2018_07_07_172111_create_client_additive_phones_table.php :

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateClientAdditivePhonesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('client_additive_phones', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('client_id');
            $table->string('phone', 255);
            $table->integer('phone_type')->unsigned();
            $table->timestamp('created_at')->useCurrent();
            $table->foreign('client_id')->references('id')->on('clients')->onUpdate('cascade')->onDelete('cascade');

            $table->index(['created_at'], 'client_additive_phones_created_at_index');
            $table->index(['phone'], 'client_additive_phones_phone_index');
            $table->index(['client_id', 'phone_type'], 'client_additive_phones_client_id_phone_type_index');
        });

        Artisan::call('db:seed', array('--class' => 'storage_space_statuses_change_Booked_name'));
        Artisan::call('db:seed', array('--class' => 'updateStorageSpaceLogsStatusLabel'));
        Artisan::call('db:seed', array('--class' => 'fillClientAdditivePhonesFromClients'));
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('client_additive_phones');
    }
}

И определение в файле: database/seeds/updateStorageSpaceLogsStatusLabel.php :

<?php

use Illuminate\Database\Seeder;

class updateStorageSpaceLogsStatusLabel extends Seeder
{   //database/seeds/updateStorageSpaceLogsStatusLabel.php
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        \App\Models\StorageSpaceLog::where('previous_status', 'Booked')->update(['previous_status' => 'Booked and Paid']);
        \App\Models\StorageSpaceLog::where('previous_status', 'reserved')->update(['previous_status' => 'Reserved and Unpaid']);

        \App\Models\StorageSpaceLog::where('status', 'Booked')->update(['status' => 'Booked and Paid']);
        \App\Models\StorageSpaceLog::where('status', 'reserved')->update(['status' => 'Reserved and Unpaid']);

    }
}

Файл с сидером на месте и класс присутствует. Ошибки в названии или пробелов не вижу...

Спасибо!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire