laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.93k stars 809 forks source link

Suggestion : customize the path for Profile or Teams Inertia pages #1491

Closed mho22 closed 2 months ago

mho22 commented 2 months ago

In my use case, I had moved the Profile directory in a Application directory to separate these from a Dashboard directory.

As Jetstream hardcoded Profile/Show within its UserProfileController@show I understood I couldn't and dived into the documentation to find out two things :

  1. Customizing Jetstream's Page Rendering
    Jetstream::inertia()->render(
        'Profile/Show',
        function (Request $request, array $data) {
            return array_merge($data, [
                // Custom data...
            ]);
        }
    );

This won't help modifying the page path of course, but next, we have this :

  1. Customizing the Authentication Views
Fortify::loginView(function () {
    return Inertia::render('Auth/Login', [
        'canResetPassword' => Route::has('password.request'),
        'status' => session('status'),
    ]);
});

Indeed related to Fortify.

Should it be possible AND interesting to suggest a PR giving the Jetstream::profileView() or Jetstream::teamsView() and other next static methods and enabling the customization of Jetstream views in the Fortify way ?

Sorry if I maybe missed something.

driesvints commented 2 months ago

Hi @mho22 I don't think we'll be modifying much here atm. You can always attempt a PR if you like to see if Taylor would accept it.