bitfumes / laravel-multiauth Goto Github PK
View Code? Open in Web Editor NEWMulti Auth and admin auth in Laravel Project
License: MIT License
Multi Auth and admin auth in Laravel Project
License: MIT License
why i cant see any controller files in the app/http/controllers of this package
ErrorException : Undefined offset: 0
at C:\Users\Shadrac\Desktop\Projects\bimapay\vendor\bitfumes\laravel-multiauth\src\Console\Commands\MakeMultiAuthCommand.php:183
179| return;
180| }
181|
182| preg_match('/\s+/**\n\s+*\s(\w+\s)+"web"\s(\w+\s)+\w+.\n/', $provider, $match);
183| $provider = str_replace($match[0], $map . $match[0], $provider);
184| /********** Function Call **********/
185|
186| $map_call = file_get_contents($this->stub_path . '/routes/map_call.stub');
187|
thank u for this package it is so helpful!
Please add command to publish a controller files to default controller.
i want to add/edit mutliauth controllers but it is difficult to me every time go to vendor and edit files.
Hi Sarthak, there is no commond define multiauth or namespace and /admin not call login page so error found in route .i am using laravel5.4.30v plz tell me.
I created my own post register method yet it still use the old post register. I modify it into redirect to login, and also var_dump the validator with a commented return
, still not works, it still redirect to route site.com/customer/register
not site.com/customer/login
/app/Http/Controllers/Customer/Auth/RegisterController.php
public function postRegistrationForm(Request $request)
{
// return $request->all();
var_dump($this->validator($request->all())->validate());
return redirect()->route('login')
->with(['success' => 'Congratulations! your account is registered, you will shortly receive an email to activate your account.']);
}
and on my routes\customer.php
Route::group(['namespace' => 'Customer'], function() {
...
Route::get('login', 'Auth\LoginController@showLoginForm')->name('customer.login');
Route::post('login', 'Auth\LoginController@login');
Route::post('register', 'Auth\RegisterController@postRegistrationForm'); // <--------
...
});
It can run the route but it has different result. I can't get the var_dump($this->validator($request->all())->validate());
Originally posted by @jeraldpunx in #45 (comment)
If i try to access route without login which has "->middleware('role:super')" it throws "Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Call to a member function roles() on null" this error.
if we want to add the email verification in admin as well as other auth like in my case there are two other auth and i m using laravel 5.7 but there is not email verify in migrations and other email verification functionality in predefined things so what i have to do now to add email verification in my admin and other users...??
is there possible to make one login form for this ?
to chek first admin auth and then > another auth > users auth??
after login redirect to specific auth view ?
Is it possible to publish the all files and assets
I use a custom admin template and my projects always have various needs of customization.
Thanks.
i got a problem when i am hit admin home/users home url without login on this time showing this error message
Call to a member function roles() on null
Thanks for this awesome project!
Do you have any plans to support language files (eg. lang/en/messages.php
) ?
php artisan migrate:rollback returns error. Not able to drop the Multiauth "admins" table.
[Logs]
...
Rolling back: 2017_03_06_053834_create_admin_role_table
Rolled back: 2017_03_06_053834_create_admin_role_table
Rolling back: 2017_03_06_023521_create_admins_table
Illuminate\Database\QueryException : SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (SQL: drop table if exists admins
)
at ..\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
Did I do anything wrongly? Please advise.
Thanks.
It gave me, I follow all from top to bottom, but I didn't create admin account, only super admin.
how can i see the error logs of unsuccessful mail requests? mails are going thru smoothly when i am using mailtrap, but not working when i am using my websites smtp settings.
when trying to make a new auth user using php artisan multiauth:make {guard} it gives an undifined index match[0] in the registerRoute function of the package in MakeMultiAUthCommand.php
For instance, after we added @admin('editor') to the post.blade.php, if we tried to access this route without login, FatalThrowableError will occur.
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function roles() on null
This happens to routes with 'super' role too,
Of course if we access the routes after login, it will be fine.
Hi Sarthak,
I need to customize your Multiauth controller & model to suit my applications. Could you please teach me the proper way to override your controller & model class/method?
So far I've been editing your controller & model inside the vendor/bitfumes/ folder. But this is not a proper way as compoer update will overwrite my changes.
Thanks.
I want the active/inactive checkbox while registering the user.
I don't have access to the controller to do so.
If it is not possible, I don't want the active/ inactive functionality.
Can you help me out to do either any one of the above issue solved.
Thanks in advance
Laravel: 6.0
PHP: 7.3.9
Database: Ver 15.1 Distrib 10.3.17-MariaDB
When running php artisan multiauth:make
I'm getting Fatal Error
due to str_plural()
helper that used in MakeMultiAuthCommand.php line 99
What is the use of the following file,
https://github.com/s-sarthak/laravel-multiauth/blame/master/src/routes/DynamicRoutes.php
is this file different from routes.php?
I've installed a the latest bitfumes/laravel-multiauth in to Laravel/framework version ^6.0.
Once I'm logged in everything works okay but when logged out and visit lets say "/admin/show" it gives an error instead of redirecting to /admin.
I've used previous bitfumes/laravel-multiauth versions on previous Laravel?framework versions and and works with no errors.
Not sure if is a bug somewhere or if is it me. I would appreciate your help.
PS: Your package is amazing, it takes a lot of headache.
Thanks
when i click on logout on the super admin, it displays BadMethodCallException
Bitfumes\Multiauth\Http\Controllers\LoginController::loggedOut does not exist
If the the session expires on the admin login, and i try to access http://multievento.test/admin/home
i get Route [login] not defined.
It should redirect to admin/login right?
But if try to access http://multievento.test/admin it redirects to login.
Thanks.
i want to get current id of the user
AdminController is not published.how to publish it???
I want this route to be protected and can be viewd only to the admins with role 'dgs admin' and 'dgcomm admin'. I am trying this, but not working for both together.
Route::get('/incidentLog', function () {
return view('incidents.incidentLog');
})->middleware('role:dgcomm admin', 'role:dgs admin');
Hi, I truly love your multi Auth package, but i am having a hard time adding the verify email feature to the new auth i created. I know i have to do this Auth::routes(['verify' => true]) in my 'web route' for normal user,
but where do i put this in the new auth, since the all routes are place in a group under the auth namespace..
I want to edit the post of RegisterController but I can't find it.
Route::post('register', 'Auth\RegisterController@register');
and when I view the app\Auth\RegisterController.php
, there is no register method.
Thank you for this awesome package.
I have a column in admin table which is accepting username while registering the user.
Now I want username to be used with the password for the login instead of email which the package provides.
I am not receiving the emails too. And I want to change the user's password using the emails.
Regards,
-Mayur
How do I get the authenticated admin ID.
Like in laravel Auth I can just do Auth:id().
when i try to logout that error generated "Call to undefined method Bitfumes\Multiauth\Model\Admin::pullCache()"
When I have used index.php
in the url the routes the /admin
it works. But without using index.php
it throws the problem. Can you please help me to solve the problem?
Note: I am using a shared hosting to deploy my project. I have changed the root
directory to public_html/public
. I have no SSH/Shell access.
I have also faced the problem after using php artisan serve
cmd in my local development environment but the problem is different.
There is no email sent to the users after they have been registered as admin.
The problem is not the mailing system because the password recovery system works.
Could there be a break or anything? I really needed that feature implemented in my production level system.
Nice package Bro. Please, integrate laravel queue into your mail system when sending mails. Thanks
http://localhost:8000/admin/home //is good
but
http://localhost:8000/admin/homedsfd like something give route error
It would be nice for other guards to create users and roles as well.
I have two authentications system. One is this multi-auth for admin and other is laravel default auth for the front user. If logout from the front user, admin automatically get log out and vice versa.
For admin logout I am using route(admin.logout) and for front user, I am using route(logout)
When you are logged in with a role other than super and manually navigate to /admin/show, the list of registered admins is visible.
Although other actions are not allowed, this minor middle-ware error should be fixed.
Hello Sarthak,
I have created one role called editor and i have registered one admin into that role, but when i am trying to delete that role its giving me an laravel error page it should be me and same error in notification like format all other activities are giving
Error Page :
Please Look into it and Fix !
Thank you & Regards
Sanmit Sanjay Pawar
[email protected],
The current Multiauth implementation is always redirect to route('admin.home') after login.
Refer sendLoginResponse function of vendor\bitfumes\laravel-multiauth\src\Http\Controllers\LoginController.php
If we want to redirect to intended path after multiauth login. How can we do it?
I tried to change sendLoginResponse function with the lines below:
//return redirect(route('admin.home'));
return $this->authenticated($request, $this->guard()->admin())
?: redirect()->intended($this->redirectPath());
But Laravel couldn't find admin(). What should be the correct implementation?
Could you please advise? Thanks.
Please how do I get the role of the authenticated admin either in controller or blade. Or in both. Thanks.
Hello sarthak,
Before Installing Multi auth package in fresh laravel project i have already installed laravel auth by (php artisan make:auth) command for normal user and for admin part i have use multi auth install command (composer require bitfumes/laravel-multiauth) but i got 1 error in command line please check image below
Please Help me with same !
Thank You
sanmit sanjay pawar
Email : [email protected]
I need to add audit trail to every model so i can track each users activity but i can not add it to admin model as its not published, how can i add audit trail to admin model ?
MultiAuth should check below items before publishing the custom guard
Consider a scenario:
// creating a gaurd with name user, which is by default exists
$ php artisan multiauth:make user
It will create user table migration and other related files which can be repeated or overwrites existing files..
Below is one of the output of such scenario:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.