jeudi 9 juillet 2020

Error on Laravel 5.1.46 running Migration

i've created a new migration to add a new column into an existing table like this:

?php

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

class AddQuantityToOrders extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->integer('quantity');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('orders', function (Blueprint $table) {
            //
        });
    }
}

But when i run php artisan migrate it gives me this error:

[Symfony\Component\Debug\Exception\FatalThrowableError]                                 
Parse error: syntax error, unexpected '''' (T_CONSTANT_ENCAPSED_STRING), expecting ')'

Any advice please?

Thanks a lot



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire