LaravelDaily/Larastarters

improve HandleInertiaRequest Middleware

spawn81 opened this issue · 1 comments

Hi, first of all, thank you for this awesome package, it's very useful.
I noticed that in the share props of the Middleware, all the user data field are passed. Thinking about the security, I guess that something like that could be very useful for the package:

 'auth' => [
                'user' => function () use ($request) {
                                       return $request->user() ? $request->user()->only(['email', 'name']) : null;

]

Hope it can be useful.
Cheers