1. Go to this page and download the library: Download eightynine/filament-reports 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/ */
eightynine / filament-reports example snippets
use EightyNine\Reports\ReportsPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('demo')
->path('demo')
...
->plugins([
ReportsPlugin::make()
]);
}
namespace App\Filament\Reports;
use EightyNine\Reports\Report;
use EightyNine\Reports\Components\Body;
use EightyNine\Reports\Components\Footer;
use EightyNine\Reports\Components\Header;
use Filament\Forms\Form;
class UserReport extends Report
{
public ?string $heading = "Report";
// public ?string $subHeading = "A report";
public function header(Header $header): Header
{
return $header
->schema([
// ...
]);
}
public function body(Body $body): Body
{
return $body
->schema([
// ...
]);
}
public function footer(Footer $footer): Footer
{
return $footer
->schema([
// ...
]);
}
public function filterForm(Form $form): Form
{
return $form
->schema([
// ...
]);
}
}