event_id = $eventId; $subscription->target_url = trim(Input::get('target_url')); $subscription->save(); if (! $subscription->id) { return Response::json('Failed to create subscription', 500); } return Response::json(['id' => $subscription->id], 201); } }