helpers refactoring

This commit is contained in:
Peter Papp
2021-03-31 08:27:28 +02:00
parent 6ac6528243
commit a8fa3694be
30 changed files with 85 additions and 211 deletions

View File

@@ -49,9 +49,7 @@ class SettingController extends Controller
*/
public function update(Request $request)
{
if (is_demo()) {
return $this->demo->response_with_no_content();
}
abort_if(is_demo(), 204, 'Done.');
// Store image if exist
if ($request->hasFile($request->name)) {
@@ -84,9 +82,7 @@ class SettingController extends Controller
public function set_email(Request $request)
{
// TODO: pridat validator do requestu
if (is_demo()) {
return $this->demo->response_with_no_content();
}
abort_if(is_demo(), 204, 'Done.');
if (!app()->runningUnitTests()) {
@@ -178,9 +174,7 @@ class SettingController extends Controller
*/
public function flush_cache()
{
if (is_demo()) {
return $this->demo->response_with_no_content();
}
abort_if(is_demo(), 204, 'Done.');
if (!app()->runningUnitTests()) {
Artisan::call('cache:clear');