admin管理员组文章数量:1122832
On laravel / livewire / jetstream site I try to change name of field by which user login into the site and I changed in config/fortify.php:
'username' => 'login', // 'email',
and checking docs for 5 branch at .html#customizing-user-authentication I read :
The authenticateUsing method accepts a closure that receives the incoming HTTP request. The closure is responsible for validating the login credentials attached to the request and returning the associated user instance. If the credentials are invalid or no user can be found, null or false should be returned by the closure. Typically, this method should be called from the boot method of your JetstreamServiceProvider:
php use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; use Laravel\Fortify\Fortify;
/** * Bootstrap any application services. */ public function boot(): void { // ...
Fortify::authenticateUsing(function (Request $request) { $user = User::where('email', $request->email)->first(); if ($user && Hash::check($request->password, $user->password)) { return $user; } }); }
But opening file app/Providers/JetstreamServiceProvider.php it has different content :
<?php
namespace App\Providers;
use App\Actions\Jetstream\DeleteUser;
use Illuminate\Support\ServiceProvider;
use Laravel\Jetstream\Jetstream;
class JetstreamServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
$this->configurePermissions();
Jetstream::deleteUsersUsing(DeleteUser::class);
}
/**
* Configure the permissions that are available within the application.
*/
protected function configurePermissions(): void
{
Jetstream::defaultApiTokenPermissions(['read']);
Jetstream::permissions([
'create',
'read',
'update',
'delete',
]);
}
}
Searching in my project I did not find any substring like Fortify::authenticateUsing
...
Very frustrated!
In which way I have to edit this file ?
"laravel/framework": "^11.31",
"laravel/jetstream": "^5.3",
"livewire/livewire": "^3.0",
Thanks in advance!
本文标签:
版权声明:本文标题:Why file appProvidersJetstreamServiceProvider.php on jetstream 5 site is different I read in docs and how to work with it? - Sta 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282613a1926698.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论