1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Http/Requests/GroupSetting/StoreGroupSettingRequest.php

59 lines
1.1 KiB
PHP
Raw Normal View History

2019-10-05 00:58:51 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Requests\GroupSetting;
use App\Http\Requests\Request;
use App\Models\GroupSetting;
use Illuminate\Support\Facades\Log;
class StoreGroupSettingRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize() : bool
{
return auth()->user()->can('create', GroupSetting::class);
}
public function rules()
{
return [
'name' => 'required',
'settings' => 'json',
]
}
public function sanitize()
{
$input = $this->all();
$this->replace($input);
}
public function messages()
{
return [
'settings' => 'settings must be a valid json structure'
];
}
}