public function rules()
{
return [
'name' => 'required|string|min:2|max:30',
'email' => ['required', 'email', Rule::unique('users', 'email')->ignore($this->id)],
'password' => 'min:8',
'role' => 'required'
];
}
}
public function rules()
{
return [
'title' => ['required', Rule::unique('vh_nodes', 'title')->ignore($this->id)],
'url' => 'required',
'login' => 'required',
'password' => 'required',
];
}
{{ old('name') }}
возвращает валидатор. Request точно, другие не использовал. $this->user = Auth::User();
это текущий авторизованный пользователь.public function invoiceView($id, $invoiceId)
{
$pdf = PDF::loadView('pdf.invoice', ['data' => User::where('id', $id], ['invoice' => Invoice::where('id', $invoiceId)->first()]);
return $pdf->stream('invoice.pdf');
}