Reputation: 1
I an having an issue in the line of code for the unique method in my Laravel rules.
I have a public property $lineId
which will update when a user clicks on edit request.
public $lineId;
// This works perfectly.
'batch_number' =>'required|unique:App\Models\BatchNumber,batch_number,298',
// This is not working.
'batch_number' =>'required|unique:App\Models\BatchNumber,batch_number,'.$this->lineId.' ',
Upvotes: -1
Views: 39