2020-03-18 10:40:15 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-03-18 10:40:15 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-03-18 10:40:15 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Setup;
|
|
|
|
|
|
|
|
use App\Http\Requests\Request;
|
|
|
|
|
|
|
|
class StoreSetupRequest extends Request
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize() : bool
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules()
|
|
|
|
{
|
2020-03-21 06:37:30 +01:00
|
|
|
return [
|
2020-03-18 10:40:15 +01:00
|
|
|
/*System*/
|
|
|
|
'url' => 'required',
|
|
|
|
/*Database*/
|
2020-12-08 14:21:00 +01:00
|
|
|
'db_host' => 'required',
|
|
|
|
'db_database' => 'required',
|
2020-03-18 10:40:15 +01:00
|
|
|
'db_username' => 'required',
|
2020-08-16 01:10:16 +02:00
|
|
|
'db_password' => '',
|
2020-03-18 10:40:15 +01:00
|
|
|
/*Mail driver*/
|
|
|
|
'mail_driver' => 'required',
|
2020-11-24 11:12:44 +01:00
|
|
|
'encryption' => 'required_unless:mail_driver,log',
|
|
|
|
'mail_host' => 'required_unless:mail_driver,log',
|
|
|
|
'mail_username' => 'required_unless:mail_driver,log',
|
|
|
|
'mail_name' => 'required_unless:mail_driver,log',
|
|
|
|
'mail_address' => 'required_unless:mail_driver,log',
|
|
|
|
'mail_password' => 'required_unless:mail_driver,log',
|
2020-03-18 10:40:15 +01:00
|
|
|
/*user registration*/
|
|
|
|
'privacy_policy' => 'required',
|
|
|
|
'terms_of_service' => 'required',
|
|
|
|
'first_name' => 'required',
|
|
|
|
'last_name' => 'required',
|
2020-10-12 23:27:42 +02:00
|
|
|
'email' => 'required|email:rfc,dns',
|
2020-09-06 11:38:10 +02:00
|
|
|
'password' => 'required',
|
2020-03-18 10:40:15 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function prepareForValidation()
|
|
|
|
{
|
|
|
|
$input = $this->all();
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
$input['user_agent'] = request()->server('HTTP_USER_AGENT');
|
2020-03-18 10:40:15 +01:00
|
|
|
|
|
|
|
$this->replace($input);
|
|
|
|
}
|
2020-03-21 06:37:30 +01:00
|
|
|
}
|