© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Soundmit

Custom page with record update

I've added a custom page to my app the page name is 'resources/views/filament/pages/ confirm-quote.blade.php the content is the same of welcome.blade.php + i've added @livewire('confirm-quote') and @livewire('notifications')

then i have created a livewire component app/livewire/ConfirmQuote.php

<?php

namespace App\Livewire;

use App\Models\Repair;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Illuminate\Contracts\View\View;
use Livewire\Component;
use Filament\Notifications\Notification; 

class ConfirmQuote extends Component implements HasForms
{
    use InteractsWithForms;
    public function acceptQuote($id, $tracking): void
    {   
        $repair = Repair::where('id', $id)
            ->where('tracking_code', $tracking)
            ->firstOrFail();
      
        $repair->update([
            'quote_accepted' => now(),
        ]);

        Notification::make() 
            ->title('Quote Accepted')
            ->body('Your quote has been accepted on '.$repair->quote_accepted->format('d/m/Y'))
            ->success()
            ->send(); 
        
        // $this->redirectRoute('livewire.confirm-quote');

    }

    public function render(): View
    {
        return view('livewire.confirm-quote');
    }
}
<?php

namespace App\Livewire;

use App\Models\Repair;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Illuminate\Contracts\View\View;
use Livewire\Component;
use Filament\Notifications\Notification; 

class ConfirmQuote extends Component implements HasForms
{
    use InteractsWithForms;
    public function acceptQuote($id, $tracking): void
    {   
        $repair = Repair::where('id', $id)
            ->where('tracking_code', $tracking)
            ->firstOrFail();
      
        $repair->update([
            'quote_accepted' => now(),
        ]);

        Notification::make() 
            ->title('Quote Accepted')
            ->body('Your quote has been accepted on '.$repair->quote_accepted->format('d/m/Y'))
            ->success()
            ->send(); 
        
        // $this->redirectRoute('livewire.confirm-quote');

    }

    public function render(): View
    {
        return view('livewire.confirm-quote');
    }
}

the confirm-quote.blade.php is a button
<button wire.loading.attr="disabled" wire:click="acceptQuote({{ request()->route('id') }}, '{{ request()->route('tracking') }}')" class="flex items-center">
<button wire.loading.attr="disabled" wire:click="acceptQuote({{ request()->route('id') }}, '{{ request()->route('tracking') }}')" class="flex items-center">

everything works,the db is correctly updated, notification appears but are without style and still on the page forever
it's my first custom page and 99% i'm doing something wrong
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Custom page with resource record error
FilamentFFilament / ❓┊help
14mo ago
Multi record update with custom column
FilamentFFilament / ❓┊help
15mo ago
Edit only single record with custom page
FilamentFFilament / ❓┊help
3y ago
Get record in custom page
FilamentFFilament / ❓┊help
3y ago