pixelfed/app/Providers/AppServiceProvider.php

66 lines
1.3 KiB
PHP
Raw Normal View History

2018-04-15 23:56:48 +00:00
<?php
namespace App\Providers;
2019-02-12 08:05:43 +00:00
use App\Observers\{
2021-07-02 07:33:49 +00:00
AvatarObserver,
LikeObserver,
NotificationObserver,
ModLogObserver,
ProfileObserver,
StatusHashtagObserver,
UserObserver,
UserFilterObserver,
2019-02-12 08:05:43 +00:00
};
2019-05-01 04:44:20 +00:00
use App\{
2021-07-02 07:33:49 +00:00
Avatar,
Like,
Notification,
ModLog,
Profile,
StatusHashtag,
User,
UserFilter
2019-05-01 04:44:20 +00:00
};
2019-02-12 07:57:49 +00:00
use Auth, Horizon, URL;
2018-05-22 23:58:48 +00:00
use Illuminate\Support\Facades\Blade;
2018-06-01 23:39:45 +00:00
use Illuminate\Support\Facades\Schema;
2018-04-15 23:56:48 +00:00
use Illuminate\Support\ServiceProvider;
2020-12-13 21:15:30 +00:00
use Illuminate\Pagination\Paginator;
2018-04-15 23:56:48 +00:00
class AppServiceProvider extends ServiceProvider
{
2021-07-02 07:33:49 +00:00
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
URL::forceScheme('https');
Schema::defaultStringLength(191);
Paginator::useBootstrap();
Avatar::observe(AvatarObserver::class);
Like::observe(LikeObserver::class);
Notification::observe(NotificationObserver::class);
ModLog::observe(ModLogObserver::class);
Profile::observe(ProfileObserver::class);
StatusHashtag::observe(StatusHashtagObserver::class);
User::observe(UserObserver::class);
UserFilter::observe(UserFilterObserver::class);
Horizon::auth(function ($request) {
return Auth::check() && $request->user()->is_admin;
});
}
2018-06-01 23:39:45 +00:00
2021-07-02 07:33:49 +00:00
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
2018-04-15 23:56:48 +00:00
}