// ProfileResource.php
public static function getPages(): array
{
return [
// I named it index so that it is still
// in the navigation
'index' => Pages\EditProfile::route('/'),
];
}
// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
protected static string $resource = ProfileResource::class;
// I am doing this so the route can be visited without
// providing the ID to the URL
public function mount(): void
{
$this->record = $this->resolveRecord(auth()->user()->profile());
$this->authorizeAccess();
$this->fillForm();
$this->previousUrl = url()->previous();
}
// ProfileResource.php
public static function getPages(): array
{
return [
// I named it index so that it is still
// in the navigation
'index' => Pages\EditProfile::route('/'),
];
}
// ProfileResourse/Pages/EditProfile.php
class EditProfile extends EditRecord
{
protected static string $resource = ProfileResource::class;
// I am doing this so the route can be visited without
// providing the ID to the URL
public function mount(): void
{
$this->record = $this->resolveRecord(auth()->user()->profile());
$this->authorizeAccess();
$this->fillForm();
$this->previousUrl = url()->previous();
}