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

AlbertLens's avatar

Laravel Nova 4 Action open non-resource view with data and filters

Hello. I would need to add several functioning to my customer's app in Nova 4. For example, I need the user to click Action and catch $fields and $models and $filters, redirecto to controller class and a specific method which will open a non-nova-resource view (I mean a freshly newly created view under resources/views).

The general idea is to open a view with the data seen by the user then, such as models, fields and filters.

return redirect()->action is not working anymore.

return redirect()->action('\App\Http\Controllers\OpenViewController@openView', compact('fields','models'));

It throws an error saying "...OpenViewController@openView not defined". But, of course, the controller is there under Http\Controllers and the name is correct and the method or function also.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class OpenViewController extends Controller
{
    public function openView() {
        
        dd('Reached here');
        
        return view('test');
    }
}

Anybody has achieved to do this?

Thank you all.

0 likes
2 replies
saiht's avatar

Hi Albert,

Did you try this (in your Nova Action)?

return Action::redirect($url); // or return parent::redirect($url);

Regards

AlbertLens's avatar

@saiht Thank you. And yes, I have tried so and it works. The problem is that I do NOT want to redirect to URL because I need to pass a lot of parameters from the database to that new URL and if I do it with the GET method of a normal URL they can all be seen by the user.

I would need to call a method in a controller made by me, of course passing data to that controller, and let the controller open a new view (not in NOVA schema).

The most important need is to call a controller passing data, like this:

return redirect()->action('\App\Http\Controllers\OpenViewController@openView', compact('fields','models'));

It throws an error saying "...OpenViewController@openView not defined".

Anyway, thank you very much for your help.

Please or to participate in this conversation.