Cannot extend resource from ActionResource
Hi, I'm using Nova 4 and I need some help.
I'm trying to customize resources/action-events page to enable the availableForNavigation value for breadcrumb access, and also change the label and singular label, as I have a menu with different title and would prefer the breadcrumb to refer the menu title instead of Actions (default if the menu linked to resources/action-events.
To achieve this, I have created a new resource called AuditTrails extending Resource which contents is basically a copy-paste with minor adjustment to support the requirement above. This works fine as it is.
However, since I only need to adjust minor stuff, I would prefer to just extend the original action resource page file (ActionResource), but this cause the page to render 404 when accessed despite rendering just fine when extending Resource.
Working code
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\KeyValue;
use Laravel\Nova\Fields\MorphToActionTarget;
use Laravel\Nova\Fields\Status;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Nova;
class AuditTrails extends Resource { // regular resurce code here }
404 code
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Actions\ActionResource;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\KeyValue;
use Laravel\Nova\Fields\MorphToActionTarget;
use Laravel\Nova\Fields\Status;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Nova;
class AuditTrails extends ActionResource { // override label, singularLabel, and availableForNavigation }
Is it not possible to just extend
ActionResource(use Laravel\Nova\Actions\ActionResource;)?Or do I have to set something else for it to work?
Please or to participate in this conversation.