6 * Bootstrap any application services. 7 */ 8public function boot(): void 9{ 10 Auth::viaRequest('custom-token', function (Request $request) { 11 return User::where('token', (string) $request->token)->first();
4 * Bootstrap any application services. 5 */ 6public function boot(): void 7{ 8 Http::macro('github', function () { 9 return Http::withHeaders([ 10 'X-Example' => 'example', 11 ])->baseUrl('https://github.com'); 12 }); 13}Once...
6 * Bootstrap any application services. 7 */ 8public function boot(): void 9{ 10 Auth::viaRequest('custom-token', function (Request $request) { 11 return User::where('token', (string) $request->token)->first(); 12 }); 13}Once...
Typically, the defaults rule should be called within the boot method of one of your application's service providers:1use Illuminate\Validation\Rules\Password; 2 3/** 4 * Bootstrap any application services. 5 */ 6public function boot(): void...
3use Laravel\Pulse\Facades\Pulse; 4use Laravel\Pulse\Value; 5 6/** 7 * Bootstrap any application services. 8 */ 9public function boot(): void 10{ 11 Pulse::filter(function (Entry|Value $entry) { 12 return Auth::user()->isNotAdmin(); 13 }); 14 15 // ... 16}Performance...
Typically, you should call this method in the boot method of one of your application's service providers:1use App\Models\Sanctum\PersonalAccessToken; 2use Laravel\Sanctum\Sanctum; 3 4/** 5 * Bootstrap any application services. 6 */ 7public function boot(): void 8{ 9 Sanctum::use...
5 * Bootstrap any application services. 6 */ 7public function boot(): void 8{ 9 Fortify::resetPasswordView(function (Request $request) { 10 return view('auth.reset-password', ['request' => $request]); 11 }); 12 13 // ... 14}Fortify...
By default, an example Echo configuration is already included in this file; however, the default configuration in the bootstrap.js file is intended for Pusher. You may copy the configuration below to transition your configuration to Ably:
9class AppServiceProvider extends ServiceProvider 10{ 11 /** 12 * Bootstrap any application services. 13 */ 14 public function boot(): void 15 { 16 Feature::resolveScopeUsing(fn ($driver) => Auth::user()?->team); 17 18 // ... 19 } 20}If...
3/** 4 * Bootstrap any application services. 5 */ 6public function boot(): void 7{ 8 Model::preventSilentlyDiscardingAttributes($this->app->isLocal()); 9}UpsertsOccasionally, you may need to update an existing model or create a new model if no matching model exists. Like the firstOr...