Support the ongoing development of Laravel.io →
Security Database Eloquent
Last updated 2 years ago.
0

You also need to open up app/config/auth.php and change 'table' item with your table name.

See https://github.com/laravel/laravel/blob/master/app/config/auth.php

Last updated 2 years ago.
0

diego1araujo said:

You also need to open up app/config/auth.php and change 'table' item with your table name.

See https://github.com/laravel/laravel/blob/master/app/config/auth.php

but m not using tht for authcation,why i need to change

and also this error occurs too when i created a function abc and called it like this User:abc();

BadMethodCallException Call to undefined method Illuminate\Database\Query\Builder::abc()

Last updated 2 years ago.
0

As I told you, It keep using 'users' table.. so maybe changing auth.php file might works

Last updated 2 years ago.
0

diego1araujo said:

As I told you, It keep using 'users' table.. so maybe changing auth.php file might works

bro thats not working but when i try to use auth::attempt function to login the users its shows me error that users tables does not exist ,after that i changed table name in auth.php in config still its not working,,what to do now ?? what this framework is for ,to create problem for its users ??

Last updated 2 years ago.
0

I've made a test. I created a new project and changed only User Model:

protected $table = 'my_user_table';

So, I added some data to this table and retrieve results:

dd(User::all()->toArray());

It was successful.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

spsethi spsethi Joined 4 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.