public function setApi($name) { $this->name = $name; $this->api = Api::where('api_name', $name)->first(); }