芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/vendor/laravel/passport/src/Http/Controllers/ClientController.php
clients = $clients; $this->validation = $validation; $this->redirectRule = $redirectRule; } /** * Get all of the clients for the authenticated user. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Database\Eloquent\Collection */ public function forUser(Request $request) { $userId = $request->user()->getAuthIdentifier(); $clients = $this->clients->activeForUser($userId); if (Passport::$hashesClientSecrets) { return $clients; } return $clients->makeVisible('secret'); } /** * Store a new client. * * @param \Illuminate\Http\Request $request * @return \Laravel\Passport\Client|array */ public function store(Request $request) { $this->validation->make($request->all(), [ 'name' => 'required|max:191', 'redirect' => ['required', $this->redirectRule], 'confidential' => 'boolean', ])->validate(); $client = $this->clients->create( $request->user()->getAuthIdentifier(), $request->name, $request->redirect, null, false, false, (bool) $request->input('confidential', true) ); if (Passport::$hashesClientSecrets) { return ['plainSecret' => $client->plainSecret] + $client->toArray(); } return $client->makeVisible('secret'); } /** * Update the given client. * * @param \Illuminate\Http\Request $request * @param string $clientId * @return \Illuminate\Http\Response|\Laravel\Passport\Client */ public function update(Request $request, $clientId) { $client = $this->clients->findForUser($clientId, $request->user()->getAuthIdentifier()); if (! $client) { return new Response('', 404); } $this->validation->make($request->all(), [ 'name' => 'required|max:191', 'redirect' => ['required', $this->redirectRule], ])->validate(); return $this->clients->update( $client, $request->name, $request->redirect ); } /** * Delete the given client. * * @param \Illuminate\Http\Request $request * @param string $clientId * @return \Illuminate\Http\Response */ public function destroy(Request $request, $clientId) { $client = $this->clients->findForUser($clientId, $request->user()->getAuthIdentifier()); if (! $client) { return new Response('', 404); } $this->clients->delete($client); return new Response('', Response::HTTP_NO_CONTENT); } }