|
@@ -3,22 +3,24 @@
|
|
namespace App\Providers;
|
|
namespace App\Providers;
|
|
|
|
|
|
use App\Observers\{
|
|
use App\Observers\{
|
|
- AvatarObserver,
|
|
|
|
- NotificationObserver,
|
|
|
|
- ModLogObserver,
|
|
|
|
- ProfileObserver,
|
|
|
|
- StatusHashtagObserver,
|
|
|
|
- UserObserver,
|
|
|
|
- UserFilterObserver,
|
|
|
|
|
|
+ AvatarObserver,
|
|
|
|
+ LikeObserver,
|
|
|
|
+ NotificationObserver,
|
|
|
|
+ ModLogObserver,
|
|
|
|
+ ProfileObserver,
|
|
|
|
+ StatusHashtagObserver,
|
|
|
|
+ UserObserver,
|
|
|
|
+ UserFilterObserver,
|
|
};
|
|
};
|
|
use App\{
|
|
use App\{
|
|
- Avatar,
|
|
|
|
- Notification,
|
|
|
|
- ModLog,
|
|
|
|
- Profile,
|
|
|
|
- StatusHashtag,
|
|
|
|
- User,
|
|
|
|
- UserFilter
|
|
|
|
|
|
+ Avatar,
|
|
|
|
+ Like,
|
|
|
|
+ Notification,
|
|
|
|
+ ModLog,
|
|
|
|
+ Profile,
|
|
|
|
+ StatusHashtag,
|
|
|
|
+ User,
|
|
|
|
+ UserFilter
|
|
};
|
|
};
|
|
use Auth, Horizon, URL;
|
|
use Auth, Horizon, URL;
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\Support\Facades\Blade;
|
|
@@ -28,54 +30,36 @@ use Illuminate\Pagination\Paginator;
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
{
|
|
- /**
|
|
|
|
- * Bootstrap any application services.
|
|
|
|
- *
|
|
|
|
- * @return void
|
|
|
|
- */
|
|
|
|
- public function boot()
|
|
|
|
- {
|
|
|
|
- URL::forceScheme('https');
|
|
|
|
- Schema::defaultStringLength(191);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 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;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
- Paginator::useBootstrap();
|
|
|
|
-
|
|
|
|
- Avatar::observe(AvatarObserver::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;
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- Blade::directive('prettyNumber', function ($expression) {
|
|
|
|
- $num = \App\Util\Lexer\PrettyNumber::convert($expression);
|
|
|
|
- return "<?php echo $num; ?>";
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- Blade::directive('prettySize', function ($expression) {
|
|
|
|
- $size = \App\Util\Lexer\PrettyNumber::size($expression);
|
|
|
|
- return "<?php echo '$size'; ?>";
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- Blade::directive('maxFileSize', function () {
|
|
|
|
- $value = config('pixelfed.max_photo_size');
|
|
|
|
-
|
|
|
|
- return \App\Util\Lexer\PrettyNumber::size($value, true);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Register any application services.
|
|
|
|
- *
|
|
|
|
- * @return void
|
|
|
|
- */
|
|
|
|
- public function register()
|
|
|
|
- {
|
|
|
|
- //
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Register any application services.
|
|
|
|
+ *
|
|
|
|
+ * @return void
|
|
|
|
+ */
|
|
|
|
+ public function register()
|
|
|
|
+ {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
}
|
|
}
|