2

I am trying to create a model along with migration as follows:

php artisan make:model Candidate -m

The output is:

Model created successfully.
Created Migration: 2022_08_06_165641_create_candidates_table

Now on the migration file:

<?php

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

class {{ class }} extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('candidates', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->softDeletes();

        });
    }

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

Everything is fine except classname of migration file.

I tried deleting vendor folder, reinstalling composer packages and clearing config. But the problem still persists.

0 Answers0