app/Http/Middleware/HandleInertiaRequests.php
/**
     * Defines the props that are shared by default.
     *
     * @see https://inertiajs.com/shared-data
     * @param  Request  $request
     * @return array
     */
Defines the props that are shared by default.
Defines the props that are shared by default .
public function share(Request $request): array
    {
        return array_merge(parent::share($request), [
            'env' => config('app.env'),
            'is_authenticated' => auth()->check(),
            'user' => auth()->check() ? (new User())->whereId(auth()->id())->with('admin')->first() : null,
        ]);
    }
public function share ( Request $ request ) : array { return array_merge ( parent :: share ( $ request ) , [ 'env' => config ( 'app.env' ) , 'is_authenticated' => auth ( ) -> check ( ) , 'user' => auth ( ) -> check ( ) ? ( new User ( ) ) -> whereId ( auth ( ) -> id ( ) ) -> with ( 'admin' ) -> first ( ) : null , ] ) ; }
Defines the props that are shared by default.
Defines the props that are shared by default .