how to make frontend user login and admin login in laravel - laravel

I have requirement of user login in frontend and also i need to make admin panel in laravel, i have create custom user table for frontend user because its have multiple other fields, in this case if i use laravel php artisan make:auth then it will create laravel login that i can redirect to different route(different admin folder in views) but if i use laravel default login and add frontend user custom fields in db table then how can i use this direction? My main question is, i need to use laravel make:auth db table for front end user and administrator user with different role or i need to make two different tables for both admin and frontuser login?

You can use the package below to do this.
The following package contains the Role&Permission - registration and login.
If your problem is not resolved, I can help you more.

Related

Laravel Nova custom action

I have just started using Laravel Nova and need to create some sort of custom action.
Within my Nova Dashboard I would like to have a button to create a new User.
I also need to generate a password and choose from a role for this user.
If User has role admin I will need to send user password per email.
What is the best way to have this action inside Nova?
Thanks!

How to use laravel default authentication in backpack

What I am doing:
I am doing a project in laravel using Backpack. In my project, there are two views. i.e. Admin view and Student view. Admin view is created using Backpack and the student view is created using auth. Admin uses the backpack's login and registration forms and routes while the student uses Laravel's auth's login and registration forms.
What I want to do:
So What I want is that I want to use Laravel's login forms and routes for logging into backpack dashboard as well and completely remove login and registration forms and routes of Backpack.
I am a newbie in laravel so maybe my question may be a little novice.
How can I do that? Kindly guide me in this regard.
You can disable all of Backpack's auth routes in config/backpack/base.php:
// Set this to false if you would like to use your own AuthController and PasswordController
// (you then need to setup your auth routes manually in your routes.php file)
'setup_auth_routes' => false,
And make Backpack use the default guard everywhere by setting this to null in the same file:
// The guard that protects the Backpack admin panel.
// If null, the config.auth.defaults.guard value will be used.
'guard' => null,
You can then use your custom auth to login both users and admins.
But make sure you differentiate between users and admins in your app\Http\Middleware\CheckIfAdmin, you wouldn't want your students to have access to your admin panel.

How to create your own module based on laravel's authentication?

I am new to laravel and currently i am learning and experimenting on my old php based mini-project conecpt ,i have successfully created the user registration and user login with some features for users,but i am confused how do i create a admin module and provide admin privilege's along with one more sub module (moderator).
I have completed website module,it works fine but i am confused how do i give the following functionalities.
how do i add admin module
admin can access user information
only admin can add moderator
any suggestions would be helpful,
Thank you.
I think what you are trying to do is make some routes only accessible by an admin or moderator?
Make a custom middleware so only if a user has a sufficient role level they can acces the given route.
https://laravel.com/docs/5.6/middleware#defining-middleware
You could have a moderator middleware that checks if a user has role 1 or higher, and a admin middleware that checks if a user has role 2.
i hope this is somewhat what you are searching for.

how to create custom login registration application laravel without using auth ,by creating own controller model

I am new in laravel. I have installed laravel 5.4. I have installed laravel inbuild auth. but I want to create own login & registration with two user type . one is customer and another is for admin with different functionalities for two user types. using custom controller,model route without using auth.

User and admin role in laravel 5.3

In my laravel project, I want some admin and user role. I want to make user login in different routes after login. And also for admin also. How should I do it?
You should first make 3 table in your database; user, role and user_role. user_role table has many to many relationship. Then you will make a middleware that checks your role checks when login. In your route, you use that middleware in login's post.
See details about middle ware in laravel 5.3 documentation.
https://www.laravel.com/docs/5.3/middleware
You can try laravel 5.3 boilerplate. It comes with a full featured access control system out of the box with an easy to learn API and is built on a Twitter Bootstrap foundation with a front and backend architecture.

Resources