mercredi 3 février 2016

Column names no longer recognized in Laravel 5

I just upgraded my site to L5 and pushed it onto my production server, but none of my column names are recognized by query builder. Everything worked in 4.2 and my L5 site still works perfectly on homestead - This is only a problem in production.

I have checked my db host, name, username and password many times in the forge .env file- they are correct.

Here is the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'company_name' in 'order clause' (SQL: select * from `contractors` where `contractors`.`deleted_at` is null and `company_id` = 2722 order by `company_name` asc)

Here is my query:

$data['contractors']= Contractor::where('company_id', '=', $localKey)
                            ->orderBy('company_name', 'asc')
                            ->get();

If I take out the ->orderBy clause, I get an error on the where clause.

Any idea what I've done to create this problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire