From 1a08039e613a1bc69b7af54ebc789ad1fb26b48e Mon Sep 17 00:00:00 2001 From: Carlos Tamagawa Date: Mon, 10 Apr 2017 19:56:22 +0000 Subject: [PATCH] fix --- .../Controllers/NewslettersController.php | 2 +- src/Http/Requests/NewslettersRequest.php | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/Http/Requests/NewslettersRequest.php diff --git a/src/Http/Controllers/NewslettersController.php b/src/Http/Controllers/NewslettersController.php index f415414..2c6daea 100644 --- a/src/Http/Controllers/NewslettersController.php +++ b/src/Http/Controllers/NewslettersController.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; use Caffeinated\Flash\Facades\Flash; use Mixdinternet\Newsletters\Services\NewslettersServices; -use Icecreamy\Frontend\Http\Requests\NewslettersRequest; +use Mixdinternet\Newsletters\Http\Requests\NewslettersRequest; use App\Http\Controllers\Controller; use Carbon; use Auth; diff --git a/src/Http/Requests/NewslettersRequest.php b/src/Http/Requests/NewslettersRequest.php new file mode 100644 index 0000000..27c3dad --- /dev/null +++ b/src/Http/Requests/NewslettersRequest.php @@ -0,0 +1,30 @@ + 'required' + , 'email' => 'required|email' + ]; + } + + if (config('mnewsletters.fields.name') == false){ + return [ + 'email' => 'required|email' + ]; + } + } + + public function authorize() + { + return true; + } + +} \ No newline at end of file