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