1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-23 01:41:34 +02:00
invoiceninja/app/Http/Requests/Setup/StoreSetupRequest.php
David Bomba 4c23d43138
Working on Setup workflow (#3509)
* Refactor designs to remove whitespace

* enable dummy data for templating

* Insert faker data into templates

* Fixes for user deletion

* Documentation on User controller:

* Working on app setup

* Files for app setup

* Working on Setup

* Final fixes for setup controller

* Fixes for setup

* Fixes for first install

* Minor fixes
2020-03-18 20:40:15 +11:00

68 lines
1.6 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @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()
{
return [
/*System*/
'url' => 'required',
'debug' => 'required',
'https' => 'required',
/*Database*/
'host' => 'required',
'database' => 'required',
'db_username' => 'required',
'db_password' => 'required',
/*Mail driver*/
'mail_driver' => 'required',
'encryption' => 'required',
'mail_host' => 'required',
'mail_username' => 'required',
'mail_name' => 'required',
'mail_address' => 'required',
'mail_password' => 'required',
/*user registration*/
'privacy_policy' => 'required',
'terms_of_service' => 'required',
'first_name' => 'required',
'last_name' => 'required',
'email' => 'required',
'password' => 'required'
];
}
protected function prepareForValidation()
{
$input = $this->all();
$input['user_agent'] = request()->server('HTTP_USER_AGENT');
$this->replace($input);
}
}