1. Go to this page and download the library: Download hayder/navigation-buttons library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hayder / navigation-buttons example snippets
namespace App\Filament\Resources\SomeResource\Pages;
use Filament\Resources\Pages\EditRecord;
use App\Filament\Resources\SomeResource;
use Hayder\NavigationButtons\Traits\HasNavigationButtons;
use Hayder\NavigationButtons\Actions\GoToPreviousRecordAction;
use Hayder\NavigationButtons\Traits\HasNavigationButtons;
class EditPage extends EditRecord
{
use HasNavigationButtons;
protected static string $resource = SomeResource::class;
protected function getHeaderActions(): array
{
return [
...
GoToPreviousRecordAction::make(),
GoToNextRecordAction::make(),
]
}
}
Notification::make()
->title('No next record found')
->danger()
->body('You are already at the last record.')
->send();