v2 first commit
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Abstracts\Http\FormRequest;
|
||||
|
||||
class Category extends Request
|
||||
class Category extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Abstracts\Http\FormRequest;
|
||||
|
||||
class Currency extends Request
|
||||
class Currency extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
@ -25,7 +25,7 @@ class Currency extends Request
|
||||
{
|
||||
// Check if store or update
|
||||
if ($this->getMethod() == 'PATCH') {
|
||||
$id = $this->currency->getAttribute('id');
|
||||
$id = is_numeric($this->currency) ? $this->currency : $this->currency->getAttribute('id');
|
||||
} else {
|
||||
$id = null;
|
||||
}
|
||||
|
40
app/Http/Requests/Setting/Module.php
Normal file
40
app/Http/Requests/Setting/Module.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use App\Abstracts\Http\FormRequest;
|
||||
|
||||
class Module extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
$module = module($this->request->get('module_alias'));
|
||||
|
||||
if ($module->get('settings')) {
|
||||
foreach ($module->get('settings') as $field) {
|
||||
if (isset($field['attributes']['required'])) {
|
||||
$rules[$field['name']] = $field['attributes']['required'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Abstracts\Http\FormRequest;
|
||||
|
||||
class Setting extends Request
|
||||
class Setting extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
@ -24,9 +24,9 @@ class Setting extends Request
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'company_name' => 'required|string',
|
||||
'company_email' => 'required|email',
|
||||
'company_logo' => 'mimes:' . setting('general.file_types', 'pdf,jpeg,jpg,png'),
|
||||
//'company_name' => 'required|string',
|
||||
//'company_email' => 'required|email',
|
||||
//'company_logo' => 'mimes:' . config('filesystems.mimes'), 'pdf,jpeg,jpg,png'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Abstracts\Http\FormRequest;
|
||||
|
||||
class Tax extends Request
|
||||
class Tax extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
|
Reference in New Issue
Block a user