userToken = $userToken; } public function index() { return $this->userToken->where('userId', '=', Auth::user()->id)->get(); } public function show($id) { return $this->userToken->where('userId', '=', Auth::user()->id)->findOrFail($id); } public function store() { $this->userToken->userId = Auth::user()->id; $this->userToken->token = sha1(mt_rand()); if ($this->userToken->save()) { return $this->userToken; } else { throw new Dingo\Api\Exception\StoreResourceFailedException; } } }