SQLSTATE [42S02]: Base table or view not found: 1146 Table

3

I have this little problem with Laravel. The old and good, problem with the S that Laravel poe in the end. I've researched a lot of forums but the given solution does not work.

  

SQLSTATE [42S02]: Base table or view not found: 1146 Table   'cautofacil.fornecedors' does not exist (SQL: select * from    fornecedors )

TABLE in MySQL CALLS SUPPLIERS

>     <?php
> 
> use Illuminate\Database\Schema\Blueprint; use
> Illuminate\Database\Migrations\Migration;
> 
> class CreateFornecedoresTable extends Migration {
> 
>     
>     /**
>      * Run the migrations.
>      *
>      * @return void
>      */
>     
>     protected $table = "fornecedores";
>     
>     public function up() {

I've already protected the table and it still puts the S bug in the end. Can someone give me a light please?

Thank you

    
asked by anonymous 26.01.2016 / 20:58

1 answer

3

It is not in Migration that does this, it is Model .

Open the created Model. Probably Suppliers.php .

Place:

protected $table = "fornecedores";

And it tests.

Documentation

link

class User extends Eloquent {

    protected $table = 'my_users';

}

Only works for named tables in English.

    
27.01.2016 / 14:41