@@ 56-69 (lines=14) @@ | ||
53 | * |
|
54 | * @return \Illuminate\Http\RedirectResponse |
|
55 | */ |
|
56 | public function createSubscriberAction() |
|
57 | { |
|
58 | try { |
|
59 | $this->dispatch(new SubscribeSubscriberCommand(Request::get('email'))); |
|
60 | } catch (ValidationException $e) { |
|
61 | return Redirect::route('dashboard.subscribers.add') |
|
62 | ->withInput(Request::all()) |
|
63 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure'))) |
|
64 | ->withErrors($e->getMessageBag()); |
|
65 | } |
|
66 | ||
67 | return Redirect::route('dashboard.subscribers.add') |
|
68 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success'))); |
|
69 | } |
|
70 | ||
71 | /** |
|
72 | * Deletes a subscriber. |
@@ 47-60 (lines=14) @@ | ||
44 | * |
|
45 | * @return \Illuminate\View\View |
|
46 | */ |
|
47 | public function postSubscribe() |
|
48 | { |
|
49 | try { |
|
50 | $this->dispatch(new SubscribeSubscriberCommand(Request::get('email'))); |
|
51 | } catch (ValidationException $e) { |
|
52 | return Redirect::route('subscribe.subscribe') |
|
53 | ->withInput(Request::all()) |
|
54 | ->withTitle(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.whoops'), trans('gitamin.subscriber.email.failure'))) |
|
55 | ->withErrors($e->getMessageBag()); |
|
56 | } |
|
57 | ||
58 | return Redirect::route('explore') |
|
59 | ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('gitamin.subscriber.email.subscribed'))); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Handle the verify subscriber email. |