0

I'm trying to develop a website with Laravel and ican't seem to create the table 'ens' getting the following error:

Use of undefined constant result -assumed 'result' <this will throw an 
  Error in a future version of PHP>

and then it indicated the line

         $table->string('photo',150)->ingres_field_nullable(result, index); 

from the following code of ens table migration

   <?php

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

 class CreateEnsTable extends Migration
{
 
  public function up()
  {
     Schema::create('ens', function (Blueprint $table) {
        $table->increments('id');
          $table->string('name');
        $table->string('email')->unique();
        $table->string('password');
        $table->string('photo',150)->ingres_field_nullable(result, index);
        $table->rememberToken();
        $table->timestamps();
    });
     }

    public function down()
   {
    Schema::dropIfExists('ens');
    }
  }
   

I can't migrate my DB table 'ens' because of it :/

Is there anything I can do to fix it? Thank you!

  • `result` and `index` aren't proper strings and aren't defined as constants either. – Jeto Jul 26 '20 at 14:34
  • 1
    ```ingres_field_nullable ( resource $result , int $index ) : bool``` first param must be the resource and the second be integer. But in your code those are undefined constants. the code is strange. – Игорь Тыра Jul 26 '20 at 14:39
  • @ИгорьТыра after pdating the code to '$table->string('photo',150)->ingres_field_nullable(resource $result, int $index): bool;' now I get this following error: **syntax error, unexpected '$result' , expecting '>'** how can i fix this? – Ikram Meraghni Jul 26 '20 at 19:37
  • in theory, code must be: ```$table->string('photo',150)->ingres_field_nullable($result, $index);``` but it will be an error "undefined variable", try to read about ingres_field_nullable on php.net – Игорь Тыра Jul 27 '20 at 06:25

0 Answers0