first
This commit is contained in:
29
app/Http/Requests/Admin/TransferOwnershipRequest.php
Normal file
29
app/Http/Requests/Admin/TransferOwnershipRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user