Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 908 Bytes

File metadata and controls

52 lines (36 loc) · 908 Bytes

🛣️ Routes

Persona can register public profile routes or let your application define its own.

✅ Built-In Routes

Example route shape:

Route::get('/@{persona:slug}', ShowPersonaController::class)
    ->name('persona.show');

⚙️ Route Configuration

'routes' => [
    'enabled' => true,
    'prefix' => '',
    'middleware' => ['web'],
    'show_name' => 'persona.show',
],

🔗 Generate Profile URLs

route('persona.show', $profile);

$profile->url();

🚫 Disable Built-In Routes

'routes' => [
    'enabled' => false,
],

Then define your own route:

Route::get('/users/{persona:slug}', ShowProfileController::class)
    ->name('profiles.show');

🔐 Route Safety

Public profile routes should use visible-profile checks.

Do not allow private or unpublished profiles to be shown unless the current user is authorized.