jeudi 20 octobre 2016

Laravel routing & database MySQL different output

I am studying Laravel Framework for few hours and i am trying to do what's being done in the tutorial i am watching. I am executing a query through routes.php and it's giving me a different output.

My database has only 1 table and it is named 'customer' and i have a model named 'customer' and a controller named 'CustomerController'

My routes.php code is this

Route::get('customer', function() {
$customer = FirstLaravelApplication\Customer::find(1);
echo '<pre>';
print_r($customer);

But the localhost is giving me an error and it says i don't have any 'customers' table, it automatically added a letter 's' in the end of the table instead of 'customer' only. i really don't have any 'customers' table i don't know why it is passing the wrong name of the table but my code only says 'customer'.

i would appreciate any help! Thanks all!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire