Support the ongoing development of →
Requests Eloquent Validation
Last updated 2 years ago.

check your controller, do not forget this

use Template


@danielzepp not sure what you mean, I have use App\Template in both the Request and Controller classes

in my Controller I have

public function update(Template $template, TemplateRequest $request)

in my RouteServiceProvider I have

Route::model('Template', App\Template::class);
Last updated 7 years ago.

OK found the trick. Here is the solution. I use segment to identify the slug to ignore then also ensure I scope the query to multitenancy.

        $id = $this->segment(4);
        $rules = 
                Rule::unique('templates')->where(function ($query) {
                    $uid = Auth::user()->id;
        return $rules;

Sign in to participate in this thread!


Your banner here too?

illmatic illmatic Joined 28 Sep 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.