I’m having trouble with Laravel Nova form submissions
I’m working with Laravel 9.41 and Nova 4. When I try to edit records, the form shows a success message but no data actually gets updated. The action_events table keeps showing empty arrays instead of the form data.
Deleting records works fine, but editing is completely broken. I’ve checked my field names and Resource files multiple times. No error messages appear, just the fake success notification.
Here’s my Resource setup:
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class Article extends Resource
{
public static $model = \App\Models\Article::class;
public static $title = 'id';
public static $search = [
'id',
'content'
];
public function fields(NovaRequest $request)
{
return [
ID::make('ID', 'id')->sortable(),
Text::make('Content', 'content')->sortable()
];
}
}
Anyone know why the frontend isn’t capturing the form values?
check your browser’s network tab in devtools when you submit - there might be a js error blocking the ajax request. also try adding ->rules('required') to your text field temporarily to test if validation’s working. nova’s frontend sometimes gets confused with caching, so try a hard refresh or incognito mode first.
hmm that’s weird - you using any custom form components or middleware that might be messing with it? what’s your Article model look like, especially the fillable array? nova gets cranky when there’s a mismatch there
Had this exact problem with Nova 4 last year. It’s usually mass assignment protection screwing things up. The form looks like it works, but Laravel’s quietly blocking the updates because your fields aren’t in the model’s fillable array. Check your Article model - make sure ‘content’ is in $fillable. Also double-check that your database column names match what you’ve got in the Nova resource fields. Could also be browser cache messing with you. Try clearing it, then run php artisan nova:publish and php artisan view:clear. Those blank arrays in action_events? That’s what happens when data never makes it to the model update.