Skip to content
Discussion options

You must be logged in to vote

On the latest version you should be able to do the following:

namespace App\Observers;

use App\Models\Post;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Nova;

class PostObserver
{
    public function creating(Post $model): void
    {
        Nova::whenServing(function (NovaRequest $request) use ($model) {
            $model->parent_id = $request->input('fromResourceId');
        });
    }
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by crynobone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Feature Request documentation Documentation issue implemented Feature Request implemented
3 participants