Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Tamagawa committed Apr 10, 2017
1 parent cbb7057 commit 1a08039
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/NewslettersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
30 changes: 30 additions & 0 deletions src/Http/Requests/NewslettersRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Mixdinternet\Newsletters\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class NewslettersRequest extends FormRequest
{
public function rules()
{
if (config('mnewsletters.fields.name') !== false){
return [
'name' => 'required'
, 'email' => 'required|email'
];
}

if (config('mnewsletters.fields.name') == false){
return [
'email' => 'required|email'
];
}
}

public function authorize()
{
return true;
}

}

0 comments on commit 1a08039

Please sign in to comment.