29 lines
462 B
PHP
29 lines
462 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Form;
|
|
|
|
use App\Models\Raid;
|
|
|
|
class RaidForm extends ModelForm
|
|
{
|
|
/**
|
|
* Redirect after this route after record was created.
|
|
*/
|
|
public string $redirect_route = 'admin.raid.index';
|
|
|
|
public function mount(Raid $raid)
|
|
{
|
|
$this->record = $raid;
|
|
$this->exist = $raid->exists;
|
|
}
|
|
|
|
/**
|
|
* Validation rules
|
|
*/
|
|
protected function rules()
|
|
{
|
|
return [
|
|
'record.name' => 'required|string|min:2|max:20',
|
|
];
|
|
}
|
|
}
|