PHP code example of burdziakm / filament-generators
1. Go to this page and download the library: Download burdziakm/filament-generators 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/ */
burdziakm / filament-generators example snippets
namespace App\Filament\Forms;
use Filament\Forms\Form;
class CarForm
{
public function build(Form $form): Form
{
return $form->schema([
//
]);
}
}
public static function form(Form $form): Form
{
return app(\App\Filament\Forms\CarForm::class)->build($form);
}
namespace App\Filament\Tables;
use Filament\Tables\Table;
class CarsTable
{
public function build(Table $table): Table
{
return $table->columns([
//
]);
}
}
public static function table(Table $table): Table
{
return app(\App\Filament\Tables\CarsTable::class)->build($table);
}
bash
php artisan make:filament-form Model
bash
php artisan make:filament-form Car
text
Filament Form [app/Filament/Forms/CarForm.php] created successfully.
text
Filament Table [app/Filament/Tables/CarsTable.php] created successfully.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.