If you're passing the id as a route parameter, you can do something as simple as this:
$this->id;
If you are passing it as an input, then you can do either one of these methods:
$this->get('id');
$this->input('id');
Not passing any ID's, just the slug. So I guess I need to do a where request to get the ID.
But when I try: 'title'=>'required|between:3,20|unique:subjects,title,'.Subject::whereTitle($this->get('title'))->first()->id, (title is unique too) I get: Trying to get property of non-object
Whenever anything other than the current title is entered.
Edit: I'll just pass the ID as a route through a hidden field, guess its simpler.
Thank-you
If you want to check the title, you can do this though.
'title'=>'required|between:3,20|unique:subjects,title,' . $this->get('title') . ',title',
So, to break this down, it basically does this.
$this->get('title')
gets the title that you are passing in from the form.Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community