Class "\Illuminate\Support\Facades\App\Models\admin" not found brother i found this error i search the internet but not found any satisfied answer. Please can you solve this issue
how and where guard is checked whether guard is admin, client or seller. if(Auth::guard('admin')->attempt($cred)){ return redirect()->route('admin.home'); } this code how to know the coming request is admin??
Validation Part indicate that error "Illuminate\Auth\EloquentUserProvider::validateCredentials(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, App\Models\admin given, called in D:\Projects\example-app\vendor\laravel\framework\src\Illuminate\Auth\SessionGuard.php"
10:54 Oh, it's unclear how to complete this step in Laravel 11. If possible, please tell me how to do it correctly (sorry for my English, i use translator:) )
Ohh, Sorry for late. Actually, Livewire 11 structure became with the missing of some files that was available in Laravel 10. But those files are still there in Laravel 11. So, To use Authenticate.php and RedirectIfAuthenticated.php file use the following Steps: 1. Open AppServiceProvider.php - import these three classes use Illuminate\Auth\Middleware\RedirectIfAuthenticated; use Illuminate\Auth\Middleware\Authenticate; use Illuminate\Support\Facades\Session; - Update boot() method like this: public function boot(): void { RedirectIfAuthenticated::redirectUsing(function () { return route('admin.dashboard'); }); Authenticate::redirectUsing(function () { Session::flash('fail','You need to login first'); return route('admin.login'); }); } Not: Don't forget to run "php artisan optimize" command after that. This is not fully result, but you can make your own strategy using above example especially when you're used multi-guards.
@@sawastacks Friend, I am very grateful to you for such a detailed answer! And thank you for your video lessons! P.S. It seems that creating a project on Laravel 11 was not the best idea 😀 It might have been easier to create a project on Laravel 10 and update it to the current version later.
@@mubeenmughal1881 Ohh very sorry. If you followed video number 4 correctly: ua-cam.com/video/LUxuc4FuMpM/v-deo.htmlsi=KvKmYZP4O7jxKzRJ Run the following commands: - composer dump-autoload - php artisan config:clear If not resolved send the following files my email address "contact@mberecall.com" - App/Models/Admin.php - App/Models/Seller.php - App/Models/User.php - App/Config/auth.php
Thanks for the good job. Pls i got stocked with the following error " Route [admin.login_handler] not defined." i have tried everything including pausing and watching the video for more than 10 times. Pls help me out
For those who need to upgrade Livewire from v2 to v3. Just watch this video:
ua-cam.com/video/b2tGFfTt2d8/v-deo.htmlsi=6a-KzA3HL_nEKJbs
when im trying session get fail it is making error session not found . i tried without get
@if(session('fail'))
{{ session('fail') }}
×
@endif
and it fixed the problem. will it make problem in future?
I have an error when I click Sign In:
The POST method is not supported for route admin/login_handler. Supported methods: GET, HEAD.
Check if you added method="POST" attribute on a form tag.
And run 'php artisan route:clear' command.
i have error, Class "\Illuminate\Support\Facades\App\Models\Admin" not found
is the proble solved ?i have the same case ?
@@lbicikande Did you solve the problem? I'm having the same problem.
Me too
I have bought your script after installing it says Route[admin.login_handler] not defined
Route[admin.login_handler] not defined
Run "php artisan optimize" command
@@sawastacks did but not working
Hello
In 14:08, when I pressed the "sign in" button, the "remember" word turns red, can you tell me what are the possible reason for this error
I have installtion issue, the script i have bought is not working i have already mailed you but no response till now,then why did i pay 9.9$??
Hi friend.
Did you check if you follow all steps (7 steps) you find in file named How to
txt? for setting up downloaded project file?
Class "\Illuminate\Support\Facades\App\Models\admin" not found brother i found this error i search the internet but not found any satisfied answer. Please can you solve this issue
add "use App\Models\Admin;" line on AdminController.php
@@sawastacks brother already tried but it's not working
i have error The GET method is not supported for route admin/logout_handler. Supported methods: POST.
check the route list as php artisan route:list and chck the rotues
how and where guard is checked whether guard is admin, client or seller.
if(Auth::guard('admin')->attempt($cred)){
return redirect()->route('admin.home');
}
this code how to know the coming request is admin??
Validation Part indicate that error
"Illuminate\Auth\EloquentUserProvider::validateCredentials(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, App\Models\admin given, called in D:\Projects\example-app\vendor\laravel\framework\src\Illuminate\Auth\SessionGuard.php"
Make sure you updated Admin.php model like this:
Class "\App\Models\Admin" not found
,
how to fix it ?
Did you remember to import "use App\Models\Admin;" on AdminController?
@@sawastacks Have done perfectly, thank you very much
@@sawastacks I'm getting an error like this
"Class "\Illuminate\Support\Facades\App\Models\Admin" not found"
10:54 Oh, it's unclear how to complete this step in Laravel 11. If possible, please tell me how to do it correctly (sorry for my English, i use translator:) )
Ohh, Sorry for late. Actually, Livewire 11 structure became with the missing of some files that was available in Laravel 10.
But those files are still there in Laravel 11.
So, To use Authenticate.php and RedirectIfAuthenticated.php file use the following Steps:
1. Open AppServiceProvider.php
- import these three classes
use Illuminate\Auth\Middleware\RedirectIfAuthenticated;
use Illuminate\Auth\Middleware\Authenticate;
use Illuminate\Support\Facades\Session;
- Update boot() method like this:
public function boot(): void
{
RedirectIfAuthenticated::redirectUsing(function () {
return route('admin.dashboard');
});
Authenticate::redirectUsing(function () {
Session::flash('fail','You need to login first');
return route('admin.login');
});
}
Not: Don't forget to run "php artisan optimize" command after that.
This is not fully result, but you can make your own strategy using above example especially when you're used multi-guards.
@@sawastacks Friend, I am very grateful to you for such a detailed answer! And thank you for your video lessons!
P.S. It seems that creating a project on Laravel 11 was not the best idea 😀 It might have been easier to create a project on Laravel 10 and update it to the current version later.
Please Fix this error. ( Auth guard [ admin] is not defined )
Hi, Just follow step by step, you'll not have this kind of error friend.
I have checked. But then again this error. 😢
@@mubeenmughal1881 Ohh very sorry. If you followed video number 4 correctly: ua-cam.com/video/LUxuc4FuMpM/v-deo.htmlsi=KvKmYZP4O7jxKzRJ
Run the following commands:
- composer dump-autoload
- php artisan config:clear
If not resolved send the following files my email address "contact@mberecall.com"
- App/Models/Admin.php
- App/Models/Seller.php
- App/Models/User.php
- App/Config/auth.php
Thanks for the good job. Pls i got stocked with the following error " Route [admin.login_handler] not defined." i have tried everything including pausing and watching the video for more than 10 times. Pls help me out
Remember to run "php artisan optimize" command in terminal if any route not defined error occured
Thanks for your answer @@sawastacks.
I just start your course and i very appreciate it thank you very much for your hard work
good job thanx a lot man.
Thank you
we are waiting new videos
Validation does not work 🙁
yeah same for me it gives me guardc adminn not found do you have same problem
Soultion Login Always Returns false
Auth guard [admin] is not defined.
Did u find solution for thar
@@khadijaleloo9622 No one has written to find a solution and Irebe Library does not provide an answer regarding a solution.
@@khadijaleloo9622 Route::prefix('admin')->name('admin.')->group(function () name('admin.' )
Undefined array key "driver" if (Auth::guard($guard)->check()) {