30 lines
635 B
PHP
30 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class TransferOwnershipRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()->isAdmin();
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'new_owner_id' => ['required', 'integer', 'exists:users,id'],
|
|
'justification' => ['required', 'string', 'min:10', 'max:1000'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'new_owner_id' => 'Pemilik baru',
|
|
'justification' => 'Justifikasi',
|
|
];
|
|
}
|
|
}
|