pixelfed/app/Providers/AppServiceProvider.php

69 lines
1.4 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,
2022-09-13 03:26:54 +00:00
StatusHashtagObserver,
StatusObserver,
2021-07-02 07:33:49 +00:00
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,
2022-09-13 03:26:54 +00:00
Status,
2021-07-02 07:33:49 +00:00
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);
2022-09-13 03:26:54 +00:00
Status::observe(StatusObserver::class);
2021-07-02 07:33:49 +00:00
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
}