I am using Laravel version 9.41 and Nova 4. I can delete records, however it appears that on the frontend/JavaScript side of things my form fields are not having their contents captured and sent back to the server. My action_events table shows [ ] empty arrays as what is being sent.
I have spent a good four or five hours googling and checking that my Resources, field names etc. are all spelled correctly. I also see no error messages. Each time I get the green success message, "This has been updated." or whatever.
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class Post extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Post>
*/
public static $model = \App\Models\Post::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'id';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id',
'text'
];
/**
* Get the fields displayed by the resource.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make('id', 'id')->sortable(),
Text::make('text', 'text')->sortable()
];
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.