Комментарии:
thank you...
ОтветитьСпасибо! всё просто и понятно! для буду использовать seed (мне показалось так удобнее), прекрасного дня из России! 🇷🇺
ОтветитьThank you very much, bro. It's just take me 2 days until now. I'm a fresher!
Ответитьthanks buddy
ОтветитьArtisan command for creating admin is better, if you want to give different names, email, or pass
ОтветитьGetting this error at C:\xampp\htdocs\laravel\jetproj\database\seeders\RoleSeeder.php:16
12▕ * @return void
13▕ */
14▕ public function run()
15▕ {
➜ 16▕ Role::create(['name' => 'Administrator']);
17▕ Role::create(['name' => 'Doctor']);
18▕ Role::create(['name' => 'Patient']);
19▕ }
20▕ }
I think something is missing that wasn't demonstrated in the video
Help, I keep getting an error in RoleSeeder.php line 17 when I run the migrate command.
ОтветитьWhat if I need to logging in using student number, instructor number, and admin number, and their password? Is this the same logic in the register you've created?
ОтветитьYou could use a factory instead of calling create directly on the model. Since factories are actual classes in Laravel 8, you could even define a state with how certain fields would be in that state. And then, for example, you could run User::factory(['name' => 'Name', 'email' => '[email protected]'])->admin()->create(); (After importing the user model in the seeder or tinker.)
ОтветитьThanks a lot for this. Please, I have a request/question.
You see, I am new to Laravel and I started with Laravel 8.
I have issues understanding "guards" and the differences between "guards" and "middlewares".
I'd also be grateful if anyone else could help me out here. I just wanna get a hold of it.
@laravelBusiness, I'll be happy if you could help me with links or a video on guards in laravel 8.
Thanks very much.
I don't think it's a good idea to use seeders for this purpose since you'll be leaving admin credentials (including the password) in your VCS.
ОтветитьI'm working on a Laravel + Vue (SPA) project and I'm currently undecided on what to use for authentication. The project already has Spatie installed and configured with couple of user roles and people have recommended me to use Sanctum on top of that for issuing tokens. I'm wondering how would I go about doing that, especially on how to handle Vue routes with Spatie user roles. Do I have to send the logged in user role on each route request back to the server to see if the user has the required permissions with Spatie? Can you please make a small tutorial video on that? It would be much appreciated. Because the documentation on Sanctum alone is not that helping when it comes to dealing with user roles. Thanks in advance.
ОтветитьJust what i needed for my project, it's like you read my mind. Thank you very much
Ответитьhi sir i have a serious problem in laravel authentication i was been tried in so many ways but i couldn't found the solution my problem is auth::check() and auth::user() are working in same method but when i try to get Auth::user() in another method of same controller getting null please help to sort out the issue
public function logincheck()
{
dd(Auth::user());
//returns null always
}
public function login()
{
$user=User::find(2);
$auth=Auth::attempt(['email' => '[email protected]', 'password' => '123456']);
//dd(Session::flash('user_signup','sai'));
dd(Auth::check());
//here working fine
}
pl make a video on laravel job queue chain and batch
if possible with telescope or horizon for better understading
So, essentially, after you do that, you have an admin login page and flow behind it where it checks for credentials and if they have the specific role?
Yesterday was dealing with really similar issue - admin logins in a Sanctum app which should be stateful. Decided to create a custom guard & user provider to check ability and return the user (both admins and users in the same table). Otherwise it seems like I would have to stick a lot of stuff into existing login logic.
Tip: If you have multiple database connections in your app, do not forget to add --database flag to specify which connection you want to use when seeding.
ОтветитьI typically use a command for that task, as it allows for variable input, so no hard coded data. But then, you're very close to the tinker solution, with the need to have local (ssh) access.
ОтветитьRails style creating <3
ОтветитьCould u please make video on one to one chat and group chat in laravel pusher and vuejs etc.
ОтветитьCan you please please make a video on laravel vapor because i only understand your videoes or documentation .
Ответить