mirror of https://github.com/pixelfed/pixelfed
chore: modernize service providers for Laravel 13 readiness
Remove deprecated Foundation\Support\Providers\AuthServiceProvider and EventServiceProvider base classes. Move policy and event listener registrations into AppServiceProvider using Gate::policy() and Event::listen(). Behavior is unchanged (verified via event:list and auth test suite).pull/6975/head
parent
00670aa3a8
commit
3c6ba88e6e
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\CustomFilter;
|
||||
use App\Policies\CustomFilterPolicy;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
CustomFilter::class => CustomFilterPolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Gate::define('viewWebSocketsDashboard', function ($user = null) {
|
||||
// return $user->is_admin;
|
||||
// });
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Listeners\AuthLogin;
|
||||
use App\Listeners\LogFailedLogin;
|
||||
use Illuminate\Auth\Events\Failed;
|
||||
use Illuminate\Auth\Events\Login;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
Login::class => [
|
||||
AuthLogin::class,
|
||||
],
|
||||
Failed::class => [
|
||||
LogFailedLogin::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
use App\Providers\AppServiceProvider;
|
||||
use App\Providers\AuthServiceProvider;
|
||||
use App\Providers\EventServiceProvider;
|
||||
use App\Providers\HorizonServiceProvider;
|
||||
use App\Providers\PassportServiceProvider;
|
||||
|
||||
return [
|
||||
AppServiceProvider::class,
|
||||
AuthServiceProvider::class,
|
||||
HorizonServiceProvider::class,
|
||||
EventServiceProvider::class,
|
||||
PassportServiceProvider::class,
|
||||
];
|
||||
|
||||
Loading…
Reference in New Issue