@darrion.kuhn
To extend the auth object in Laravel, you can create a new class that inherits from the Laravel IlluminateAuthAuthManager
class and then register your custom auth object in the AuthProvider
in the Laravel application.
Here is an example of how you can extend the auth object in Laravel:
1 2 3 4 5 6 7 8 9 10 |
// app/CustomAuthManager.php namespace App; use IlluminateAuthAuthManager; class CustomAuthManager extends AuthManager { // Add custom methods or properties here } |
1 2 3 4 5 6 7 8 9 10 |
// app/Providers/AuthServiceProvider.php use AppCustomAuthManager; public function register() { $this->app->singleton('auth', function ($app) { return new CustomAuthManager($app); }); } |
1 2 3 |
// config/auth.php 'response' => AppCustomAuthManager::class, |
Now, you have extended the auth object in Laravel using a custom class. You can add custom methods or properties to your custom auth object as needed.