Someone could please tell me what is my mistake

2

hello knows I try to do a crud with laravel 5.6 and with table called t_areaFuncional but my model is AreaFuncional and my controller AreaFuncionaController, deactivate .. the convention that laravel has. with respect to migrations ... my table in the database is called "t_areaFuncional" but laravel generates by default the query "select * from t_areafuncional where id " HELP !!

    
asked by Rudy 31.08.2018 в 01:14
source

1 answer

2

According to the Laravel documentation: link

The property declaration that will overwrite the default way Eloquent seeks to use a primary key that is only by the name of id should be declared as such

protected $primaryKey = 'idAreaFuncional';
  

Also take into account that Laravel will assume that the primary key is   incremental auto and type INT/BIGINT as the case may be

    
answered by 31.08.2018 / 01:24
source