Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CodyMcCode's avatar

Filament showing a blank edit resource form

Hello,

I have created a model in artisan, defined a migration and set the fillable properties on the form.

When I run php artisan make:filament-resource Customer

A resource is created (files and folder structure) but the resource form is blank and simply shows the "create, create and create another, cancel" buttons.

My question is what am I missing here i.e. what do I need to do to ensure the crud forms are automatically generated by Filament rather than requiring manual effort. Not sure what I have missed. I've seen this posted before but there wasn't a definitive resolution other than the fillable suggestion.

Thanks!

0 likes
4 replies
LaryAI's avatar
Level 58

It sounds like you're encountering an issue where the form fields are not being automatically generated in your Filament resource. This can happen if the form schema is not properly defined in the resource class. Here’s a step-by-step solution to ensure that your CRUD forms are generated correctly:

  1. Check the Resource Class: Ensure that the form schema is defined in the CustomerResource class. This is typically found in app/Filament/Resources/CustomerResource.php.

  2. Define the Form Schema: You need to define the form fields in the form method of the CustomerResource class. Here’s an example of how you can do this:

  1. Check the Model: Ensure that the Customer model has the necessary fillable properties defined. This is typically found in app/Models/Customer.php.
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Customer extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'email',
        // Add other fillable properties as necessary
    ];
}
  1. Run Migrations: Ensure that you have run the migrations to create the necessary database tables.
php artisan migrate
  1. Clear Cache: Sometimes, caching issues can cause unexpected behavior. Clear the cache to ensure that your changes are reflected.
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear

By following these steps, you should be able to see the form fields in your Filament resource. If the form is still blank, double-check that the form schema is correctly defined and that there are no typos or syntax errors in your code.

jaseofspades88's avatar

The ‘manual effort’ you refer to is telling your filament resources which fields of the model you want to edit. There will be an empty schema function in your form method on your CustomerResource. In here you need to put things like…

[
	TextInput::make(‘name’),
];

Without this, filament doesn’t know which fields on your model to interact with. Filament gives you a lot out of the box but it can’t read your mind….

CodyMcCode's avatar

@jaseofspades88 Ah right ok thanks. I figured it took this from fillable and I was making an error somewhere else but that makes sense. Thanks.

CodyMcCode's avatar

Ah, just an update for anyone else browsing here. Using the --generate flag automatically makes a form and table for the resource based on the models data column like so:

php artisan make:filament-resource Customer --generate

Then you can edit or remove from there.

As the docs state "If you'd like to save time, Filament can automatically generate the form and table for you, based on your model's database columns, using --generate:"

Please or to participate in this conversation.