diff --git a/app/Http/Controllers/Backend/SettingController.php b/app/Http/Controllers/Backend/SettingController.php index 344ee6768..96f2d6f98 100644 --- a/app/Http/Controllers/Backend/SettingController.php +++ b/app/Http/Controllers/Backend/SettingController.php @@ -68,7 +68,8 @@ public function index() public function store(Request $request) { $rules = Setting::getValidationRules(); - $data = $request->validate($request, $rules); + + $data = $request->validate($rules); $validSettings = array_keys($rules); diff --git a/config/setting_fields.php b/config/setting_fields.php index a0e2bcafd..ff97e7364 100644 --- a/config/setting_fields.php +++ b/config/setting_fields.php @@ -39,7 +39,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'show_copyright', // unique name for field 'label' => 'Show Copyright', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => '1', // default value if you want ], @@ -74,7 +74,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'website_url', // unique name for field 'label' => 'Website URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => 'https://nasirkhn.com', // default value if you want ], @@ -83,7 +83,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'facebook_url', // unique name for field 'label' => 'Facebook Page URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => '#', // default value if you want ], @@ -92,7 +92,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'twitter_url', // unique name for field 'label' => 'Twitter Profile URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => 'https://twitter.com/nasirkhansaikat', // default value if you want ], @@ -101,7 +101,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'instagram_url', // unique name for field 'label' => 'Instagram Account URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => 'https://www.instagram.com/nasirkhansaikat', // default value if you want ], @@ -110,7 +110,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'youtube_url', // unique name for field 'label' => 'Youtube Channel URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => 'https://www.youtube.com/@nasirkhan', // default value if you want ], @@ -119,7 +119,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'linkedin_url', // unique name for field 'label' => 'LinkedIn URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => '#', // default value if you want ], @@ -128,7 +128,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'whatsapp_url', // unique name for field 'label' => 'WhatsApp URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => '#', // default value if you want ], @@ -137,7 +137,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'messenger_url', // unique name for field 'label' => 'Messenger URL', // you know what label it is - 'rules' => 'required|nullable|max:191', // validation rule of laravel + 'rules' => 'nullable|max:191', // validation rule of laravel 'class' => '', // any class for input 'value' => '#', // default value if you want ], @@ -173,7 +173,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'meta_keyword', // unique name for field 'label' => 'Meta Keyword', // you know what label it is - 'rules' => 'required', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => 'Web Application, web app, Laravel, Laravel starter, Bootstrap, Admin, Template, Open Source, nasir khan saikat, nasirkhansaikat', // default value if you want ], @@ -191,7 +191,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'meta_fb_app_id', // unique name for field 'label' => 'Meta Facebook App Id', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => '569561286532601', // default value if you want ], @@ -200,7 +200,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'meta_twitter_site', // unique name for field 'label' => 'Meta Twitter Site Account', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => '@nasirkhansaikat', // default value if you want ], @@ -209,7 +209,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'meta_twitter_creator', // unique name for field 'label' => 'Meta Twitter Creator Account', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => '@nasirkhansaikat', // default value if you want ], @@ -226,7 +226,7 @@ 'data' => 'text', // data type, string, int, boolean 'name' => 'google_analytics', // unique name for field 'label' => 'Google Analytics (gtag)', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => 'G-ABCDE12345', // default value if you want 'help' => 'Paste the only the Measurement Id of Google Analytics stream.', // Help text for the input field. @@ -245,7 +245,7 @@ 'data' => 'string', // data type, string, int, boolean 'name' => 'custom_css_block', // unique name for field 'label' => 'Custom Css Code', // you know what label it is - 'rules' => '', // validation rule of laravel + 'rules' => 'nullable', // validation rule of laravel 'class' => '', // any class for input 'value' => '', // default value if you want 'help' => 'Paste the code in this field.', // Help text for the input field.