Can you share TeamViewer or anydesk with me?

|
zey34354 2022-05-23 10:53:30
but it didn’t work
AzerMammadli 2022-05-23 10:53:31
use AppHttpControllersAdminPanel/User;
zey34354 2022-05-23 10:53:43
AzerMammadli 2022-05-23 10:53:31
use AppHttpControllersAdminPanel/User;

its the same

zey34354 2022-05-23 10:53:53
not diff
zey34354 2022-05-23 10:54:03
no
AzerMammadli 2022-05-23 10:54:19
Can you share TeamViewer or anydesk with me?
anujrock1 2022-05-23 10:57:01
zey34354 2022-05-23 10:50:03
where is the problem here

laravel_discuss-121941.jpg
Wrong syntax, User::all();

If you are trying to list all user,

By using User(), you are calling a function name User

anujrock1 2022-05-23 10:58:00
AzerMammadli 2022-05-23 10:53:31
use AppHttpControllersAdminPanel/User;

Error is something else, check my above comment

AzerMammadli 2022-05-23 10:58:39
anujrock1 2022-05-23 10:58:00
Error is something else, check my above comment

for example ->get();

anujrock1 2022-05-23 11:00:51
AzerMammadli 2022-05-23 10:58:39
for example ->get();

Yes, any operation

I think he trying to get data feom user tabel using eloquent orm

As he also imported User model class

But don’t know how to do actually, or by mistake he miss out

Waxikevin 2022-05-23 11:05:23
zey34354 2022-05-23 10:49:53

Try this instead
User::all();

zey34354 2022-05-23 11:07:49
Waxikevin 2022-05-23 11:05:23
Try this instead
User::all();

okay I did it thank you so mucg

zey34354 2022-05-23 11:07:59
much
zey34354 2022-05-23 11:46:39
laravel_discuss-121948.jpg

zey34354 2022-05-23 11:46:49
what is the error in this
segungreat 2022-05-23 11:57:21
zey34354 2022-05-23 11:46:49
what is the error in this

Show the blade file or where you instantiate the error.

You’re trying to get role which does not exist in the object

zey34354 2022-05-23 12:28:20
segungreat 2022-05-23 11:57:21
Show the blade file or where you instantiate the error.

You’re trying to get role which does not exist in the object

what is the place exactly that should I send it

zey34354 2022-05-23 12:28:31
I don’t know
Waxikevin 2022-05-23 12:34:33
zey34354 2022-05-23 11:46:49
what is the error in this

Try this
User::with(roles)->get();

zey34354 2022-05-23 12:38:33
Waxikevin 2022-05-23 12:34:33
Try this
User::with(roles)->get();

in controller
any place exactly

zey34354 2022-05-23 12:38:44
its not clear with me
Waxikevin 2022-05-23 12:42:24
Are you trying to get user’s roles?
CreativeModernDev 2022-05-23 12:45:12
VishalNarang 2022-05-23 07:45:18
*We www.passproviders.com are looking for 4 full time web developers in Amritsar.*

*Timings : 9 am to 6.30 pm*

*Work from office at Bus Stand Amritsar*

Salary Rs 15000 to Rs 40000 without incentives depending upon skills and experience

Skil required are :
PHP
Laravel
MySQL
CSS
Ajax
jQuery
Html
Bootstrap

Interested candidates ad HR Agencies are requested to contact

9814607080

Hi, I think that I am capable of doing your project.

anujrock1 2022-05-23 13:32:40
Waxikevin 2022-05-23 12:34:33
Try this
User::with(roles)->get();

I think little bit syntax error

User::with(‘roles’)->get();

anujrock1 2022-05-23 13:33:04
zey34354 2022-05-23 12:38:33
in controller
any place exactly

Have you defined your roles relationship in User model?

zey34354 2022-05-23 13:33:53
Waxikevin 2022-05-23 12:42:24
Are you trying to get user’s roles?

yes

zey34354 2022-05-23 13:34:03
anujrock1 2022-05-23 13:33:04
Have you defined your roles relationship in User model?

yes

zey34354 2022-05-23 13:34:14
let me send them to see
anujrock1 2022-05-23 13:34:15
anujrock1 2022-05-23 13:32:40
I think little bit syntax error

User::with(‘roles’)->get();

Use this

zey34354 2022-05-23 13:35:06
anujrock1 2022-05-23 13:32:40
I think little bit syntax error

User::with(‘roles’)->get();

where do I have to use it exactly

zey34354 2022-05-23 13:35:16
I didn’t get it
zey34354 2022-05-23 13:35:48
perhaps I have a problem in relationship but I am not sure
zey34354 2022-05-23 13:36:11
in model (user)

public function roles(): IlluminateDatabaseEloquentRelationsBelongsTo
{
return $this->belongsToMany(Role::class,’role_users’);
}

anujrock1 2022-05-23 13:36:13
zey34354 2022-05-23 13:35:48
perhaps I have a problem in relationship but I am not sure

Show us your code

anujrock1 2022-05-23 13:36:29
zey34354 2022-05-23 13:35:06
where do I have to use it exactly

In your controller

|