Skip to content

Commit

Permalink
Company setting required added.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jan 29, 2021
1 parent 416c8c0 commit c506f48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions app/Http/Requests/Setting/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,20 @@ public function authorize()
*/
public function rules()
{
$name = 'nullable';
$email = 'nullable';
$logo = 'nullable';

if ($this->request->get('_prefix', null) == 'company') {
$name = 'required|string';
$email = 'required|email';
$logo = 'mimes:' . config('filesystems.mimes', 'pdf,jpeg,jpg,png');
}

return [
//'company_name' => 'required|string',
//'company_email' => 'required|email',
//'company_logo' => 'mimes:' . config('filesystems.mimes'), 'pdf,jpeg,jpg,png'),
'name' => $name,
'email' => $email,
'logo' => $logo,
];
}
}
2 changes: 1 addition & 1 deletion resources/views/settings/company/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

{{ Form::textareaGroup('address', trans('settings.company.address'), null, setting('company.address')) }}

{{ Form::fileGroup('logo', trans('settings.company.logo'), 'file-image-o', ['dropzone-class' => 'form-file', 'options' => ['acceptedFiles' => 'image/*']], setting('company.logo')) }}
{{ Form::fileGroup('logo', trans('settings.company.logo'), 'file-image-o', ['options' => ['acceptedFiles' => 'image/*']], setting('company.logo')) }}
</div>
</div>

Expand Down

0 comments on commit c506f48

Please sign in to comment.