public function create() { $this->response()->headers()->setContentType('text/javascript'); $this->setLayout(false); if ($this->request()->isPost()) { if (current_user()->tag_subscriptions->size() >= CONFIG()->max_tag_subscriptions) { $this->tag_subscription = null; } else { $this->tag_subscription = TagSubscription::create(['user_id' => current_user()->id, 'tag_query' => '']); } } }