jaseofspades88's avatar

jaseofspades88 liked a comment+100 XP

4mos ago

awesome

jaseofspades88's avatar

jaseofspades88 wrote a reply+100 XP

5mos ago

This is documented here: https://laravel.com/docs/12.x/authentication#redirecting-authenticated-users.

use Illuminate\Http\Request;

->withMiddleware(function (Middleware $middleware): void {
    $middleware->redirectUsersTo('/panel');

    // Using a closure...
    $middleware->redirectUsersTo(fn (Request $request) => route('panel'));
})

These changes should be made in the empty closure you will find in the bootstrap/app.php.

jaseofspades88's avatar

jaseofspades88 wrote a reply+100 XP

5mos ago

Muscle memory helps and once you're comfortable with the layout of a codebase, you'll be fine. Get a good IDE and remember helpful keyboard shortcuts; specific file search and recently edited files are two of the most useful shortcuts you'll ever use.

jaseofspades88's avatar

jaseofspades88 wrote a reply+100 XP

5mos ago

What problem are you trying to solve? Are you trying to get the schema for use elsewhere?

I imagine you're using v3 and older as the improvements to components and such in v4 solves this problem... however, I would recommend you simply abstract out the fields you need into a static method on a class. ToolbarActionForm or something, which has a static get method, which returns the array of the components you require.