PatrickCaneloDigital's avatar

Jetstream Fortify personalization (Inertia/vue)

I am currently trying to personalize Fortify login vues, and struggle with some things. I am no newbie at all in programming, but in Fortify/Jetstream/inertia I am

a) What is the recommended way of personalization? maintain the original vues and edit them (Login/Register/etc)? define new views and register them in web.php? Or modify the FortifyServiceProvider? At the moment I was editing web.php routes, and using new .vues, but I don't know if I loose access to something

At the moment I am using my own web.php links for login and register and my own vues

Route::get('login', function () {
    return Inertia::render('auth/cover-login');
})->name('login');

and it works sofar even with verification email, but I'm kinda insure about if it's the proper way (yes, some would say: if it works, it's ok) or if I loose someting that way.

b) The default jetstream app has in the web.php route for the welcome page these params

Route::get('/', function () {
    return Inertia::render('Welcome', [
        'canLogin' => Route::has('login'),
        'canRegister' => Route::has('register'),
        'laravelVersion' => Application::VERSION,
        'phpVersion' => PHP_VERSION,
    ]);
});

Here a double question: What does this Route::has do? And how can I give these parameters to the login vue (Easy if I use my own route, copy the code, but is that the way?)

c) The default Welcome.vue fresh out of the box uses these props to create conditional links, like

<nav v-if="canLogin"

and

<Link v-if="canRegister"

in the sample app, are these just used for demo purposes or is there something more behind? I want my login view to be able to redirect to register, if a user hasn't signed up yet so I am torn between simply removing that link condition and render it anyway, or passing the param as is to my cover-login.vue . it all comes back to the Route::has and it's meaning... because off course, I just could remove the conditions, and lean back

Thx for clearing out the mists, even if these are dummy questions

0 likes
0 replies

Please or to participate in this conversation.