I have two column 'book_name' & 'writer' in 'books' table. When new data insert i want to check the same book and writer not will be added. But i dont understand how to do this. here is my code.
public function rules()
{
return [
'book_name' => 'required|unique:books,book_name,' . $this->id,
'writer' => 'required|unique:books,writer,' . $this->id,
];
}