. */ namespace Poniverse\Ponyfm\Http\Controllers; use Poniverse\Ponyfm\Models\Email; use Poniverse\Ponyfm\Models\EmailClick; use Poniverse\Ponyfm\Models\EmailSubscription; use View; class NotificationsController extends Controller { public function getEmailClick($emailKey) { $emailKey = decrypt($emailKey); /** @var Email $email */ $email = Email::findOrFail($emailKey); $email->emailClicks()->create(['ip_address' => \Request::ip()]); return redirect($email->getActivity()->url); } public function getEmailUnsubscribe($subscriptionKey) { $subscriptionId = decrypt($subscriptionKey); $subscription = EmailSubscription::findOrFail($subscriptionId); return var_export($subscription); } }