Filament Laravel
Create a resource using Filament in Laravel Application
To create resource, create DB migration file by using this command
php artisan make:model <ResourceName> -mEdit DB migration file (database/migration/ResourceName.php)
$table->string('name');
$table->json('attachments');
$table->string('email');
$table->text('description');
$table->longText('long_description');
$table->integer('number');
$table->uuid('product_id');
$table->increments('id');
$table->decimal('amount', 10, 2);
$table->date('created_at');
$table->time('sunrise', 0);
$table->dateTime('created_at', 0);
$table->foreignId('user_id');->nullable();
->autoIncrement();
->unique();
->index();Edit Model file (Model/ResourceName.php)
Run the database migration
Create a filament resource menu
Create a form for the resource by edit Resources file (app/Filament/Resource)
To redirect back to table after user submit form, paste this code inside class (app\Filament\Resources\NameResource\Pages\CreateResource.php and EditResource.php)
To create table resource, Edit Resources file (app/Filament/Resources)
Last updated