How to check whether a user has role in laravel?

|
DesolatorMagno 2021-06-28 16:19:23
ateframadan22 2021-06-28 16:18:48
example, statuses can be accepted, pending, shipped. and there’s that user that can only see accepted

That’s not order, that would be to filter data.

ateframadan22 2021-06-28 16:19:33
ya, filter.. sorry lol
Prakash Thakur 2021-06-28 16:19:57
https://www.freshngreen.online
DesolatorMagno 2021-06-28 16:20:05
You can manage it with scope.
Prakash Thakur 2021-06-28 16:20:26
Prakash Thakur 2021-06-28 16:19:57
https://www.freshngreen.online

I need this type of website app and delivery app

Prakash Thakur 2021-06-28 16:20:37
Anybody can do it
ateframadan22 2021-06-28 16:20:53
I did write every scope, the orders have like 6 states, and I have array of the permissions
ateframadan22 2021-06-28 16:21:32
can I loop though them, or just use if statements
DesolatorMagno 2021-06-28 16:22:24
You can map permission with status and do a where in for status.
ateframadan22 2021-06-28 16:23:48
ty, will google that
ateframadan22 2021-06-28 16:33:13
well, I found package called laravel-query-builder, and It does filter with permissions easy
DesolatorMagno 2021-06-28 16:43:16
If it does what you need them go with it.
Hazar_Orabi 2021-06-28 16:49:53
I want to learn Larvel from the beginning and I want to start with a website but I don’t know how to start
Aniket Bhosale 2021-06-28 16:50:41
any library to create dynamic documentation of project
Hazar_Orabi 2021-06-28 16:53:02
I want a course link in which to implement my work, please
S3NX_8 2021-06-28 16:53:32
Hello there I have problem

In the database I have a company that belongs to user
And there is a movie data that’s added for company
How can I filter movies that are associated with the company which belongs to the current logedin user

DesolatorMagno 2021-06-28 16:53:44
Hazar_Orabi 2021-06-28 16:49:53
I want to learn Larvel from the beginning and I want to start with a website but I don’t know how to start

https://laravel.com/docs/8.x
https://laracasts.com/

DesolatorMagno 2021-06-28 16:54:19
$user->company->movies
ateframadan22 2021-06-28 16:55:21
DesolatorMagno 2021-06-28 16:43:16
If it does what you need them go with it.

it doesn’t, Only for requests filtering rip

DesolatorMagno 2021-06-28 16:56:09
ateframadan22 2021-06-28 16:55:21
it doesn’t, Only for requests filtering rip

I know, you are the one who said it could filter by role 😅

ateframadan22 2021-06-28 17:02:00
do u have any source I could look into to understand how to solve this issue
DesolatorMagno 2021-06-28 17:06:09
You can try solving it using if
$status = []
if perm == something
$status[] = ‘accepted’ // uggly way to store status
endif

Model::whereIn(‘status’,$status)->get()

DesolatorMagno 2021-06-28 17:06:29
Once it work you can take your time to make it better.
ateframadan22 2021-06-28 17:07:32
ok thx mate
codingtracker 2021-06-28 22:01:02
https://codingtracker.blogspot.com/2021/06/laravel-pagination-get-next-page.html

Laravel Pagination Get Next Page TutorialBlogspot
laravel pagination get next page url,laravel pagination next page,laravel pagination total pages,laravel pagination get page number,laravel pagination
justine_chacko 2021-06-29 07:56:53
I need to send an Ajax request from post man. I set Accept : application/json and x-requested-with : xmlhttprequest. Is this enough? Can I echo the result in controller or do I return the result
saboorhamedi 2021-06-29 08:12:37
Hello, I am trying to learn jetstream, and I face an issue, I added this tag but not showing <x-slot name=”nav”>Hello</x-slot>
2021-06-29 08:25:29
Please check computer peripheral tab and set a view option, if you click on mouse.
2021-06-29 08:25:58
How to set view if you click on mouse
Jaseel 2021-06-29 08:32:30
justine_chacko 2021-06-29 07:56:53
I need to send an Ajax request from post man. I set Accept : application/json and x-requested-with : xmlhttprequest. Is this enough? Can I echo the result in controller or do I return the result

Return response

steeek 2021-06-29 08:43:39
how to check whether a user has role in laravel ? for a specific user
Bhuvi100 2021-06-29 08:44:56
steeek 2021-06-29 08:43:39
how to check whether a user has role in laravel ? for a specific user

Are you using any package?

steeek 2021-06-29 08:45:31
spatie
steeek 2021-06-29 08:45:48
Bhuvi100 2021-06-29 08:44:56
Are you using any package?

spatie

Bhuvi100 2021-06-29 08:49:14
https://spatie.be/docs/laravel-permission/v3/basic-usage/role-permissions#breadcrumb

Using Permissions via Roles | laravel-permissionspatie.be
|