Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Amalmax's avatar

php artisan migrate error

Hi, when I excute to create my database on CLI php artisan migrate in laravel 5.2 it generate following error on my CLI.

[Error Exception]
The use statement with non-compound name ' IluminateDatabaseShemaBlueprint ' has no effect

one of my table here

<?php

use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function(Blueprint $table)
        {
            $table->increments('id')->unsigned();
            $table->string('username')->unique();
            $table->string('email')->unique();
            $table->string('password');
            $table->string('first_name')->nullable();
            $table->string('last_name')->nullable();
            $table->string('avatar_url')->nullable()->default(NULL);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
0 likes
1 reply
tomopongrac's avatar
Level 51

@Amalmax

You must write

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
2 likes

Please or to participate in this conversation.