barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.63k stars 290 forks source link

404 page not found #438

Closed Kobershan closed 3 years ago

Kobershan commented 3 years ago

I've created a crud table for employees. When you click on open payslip it should generate a pdf for the employee. The link works fine when im getting all the crud information but when i look to pull a specific line based on id. It returns a 404 page not found.Im using barryvdh/laravel-snappy, Laravel 8 with PHP 8. Any help will be appreciated. this is my code:

 Route::get('payslip/{$id}', [App\Http\Livewire\EmployeesTable::class, 'payslip'])
            ->name('livewire.employees.payslip');

My Controller and my blade calling for the id:

       use Livewire\Component;
       use Illuminate\Http\Request;
       use App\Models\Employees;
       use App\Models\User;
       use App\Models\Team;
       use Livewire\WithPagination;
       use PDF;

    public function payslip($id)
    {
        $employees = Employees::findOrFail($id);
        $teams = Team::all();
        $pdf = PDF::loadView('livewire.employees.payslip',compact('teams', 'employees'));
        return $pdf->stream('payslip.pdf'); 
    }
Open payslip
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.