Update AppServiceProvider

This commit is contained in:
Daniel Supernault 2024-07-30 22:25:48 -06:00
parent 73b9a75a64
commit a5946f590b
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -5,6 +5,7 @@ namespace App\Providers;
use App\Observers\{ use App\Observers\{
AvatarObserver, AvatarObserver,
FollowerObserver, FollowerObserver,
HashtagFollowObserver,
LikeObserver, LikeObserver,
NotificationObserver, NotificationObserver,
ModLogObserver, ModLogObserver,
@ -17,6 +18,7 @@ use App\Observers\{
use App\{ use App\{
Avatar, Avatar,
Follower, Follower,
HashtagFollow,
Like, Like,
Notification, Notification,
ModLog, ModLog,
@ -32,6 +34,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator; use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Database\Eloquent\Model;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
@ -50,6 +53,7 @@ class AppServiceProvider extends ServiceProvider
Paginator::useBootstrap(); Paginator::useBootstrap();
Avatar::observe(AvatarObserver::class); Avatar::observe(AvatarObserver::class);
Follower::observe(FollowerObserver::class); Follower::observe(FollowerObserver::class);
HashtagFollow::observe(HashtagFollowObserver::class);
Like::observe(LikeObserver::class); Like::observe(LikeObserver::class);
Notification::observe(NotificationObserver::class); Notification::observe(NotificationObserver::class);
ModLog::observe(ModLogObserver::class); ModLog::observe(ModLogObserver::class);
@ -62,6 +66,8 @@ class AppServiceProvider extends ServiceProvider
return Auth::check() && $request->user()->is_admin; return Auth::check() && $request->user()->is_admin;
}); });
Validator::includeUnvalidatedArrayKeys(); Validator::includeUnvalidatedArrayKeys();
// Model::preventLazyLoading(true);
} }
/** /**