35 lines
810 B
PHP
35 lines
810 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Projects;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class UpdateProjects extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return Auth::checK();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
// TODO : compléter les rules
|
|
'prod_laravel_app_key' => 'required_if:type,3',
|
|
'dev_laravel_app_key' => 'required_if:type,3',
|
|
'prod_smtp_config' => 'integer|required',
|
|
'prod_smtp_key' => 'required_if:prod_smtp_config,3'
|
|
];
|
|
}
|
|
}
|