You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
784 B

  1. <?php
  2. namespace App\Http\Middleware;
  3. use Illuminate\Http\Request;
  4. use Inertia\Middleware;
  5. class HandleInertiaRequests extends Middleware
  6. {
  7. /**
  8. * The root template that is loaded on the first page visit.
  9. *
  10. * @var string
  11. */
  12. protected $rootView = 'app';
  13. /**
  14. * Determine the current asset version.
  15. */
  16. public function version(Request $request): string|null
  17. {
  18. return parent::version($request);
  19. }
  20. /**
  21. * Define the props that are shared by default.
  22. *
  23. * @return array<string, mixed>
  24. */
  25. public function share(Request $request): array
  26. {
  27. return [
  28. ...parent::share($request),
  29. 'auth' => [
  30. 'user' => $request->user(),
  31. ],
  32. ];
  33. }
  34. }