- Introduced routes for managing admin settings including system, homepage, social media, marketplace, and HR settings. - Created a comprehensive test suite for the AdminSettingsController to ensure proper functionality and validation of settings updates. - Implemented tests for authentication, data integrity, and realistic user scenarios to validate the settings management process.
36 lines
870 B
PHP
36 lines
870 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Settings;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSystemRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'app_name' => ['required', 'string', 'max:255'],
|
|
'about_app' => ['nullable', 'string', 'max:2000'],
|
|
'address' => ['nullable', 'string', 'max:500'],
|
|
'email' => ['nullable', 'email', 'max:255'],
|
|
'phone' => ['nullable', 'string', 'max:20'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'app_name' => 'nama aplikasi',
|
|
'about_app' => 'tentang aplikasi',
|
|
'address' => 'alamat',
|
|
'email' => 'email',
|
|
'phone' => 'nomor telepon',
|
|
];
|
|
}
|
|
}
|