authorize('viewAny', SshKey::class); return Inertia::render('ssh-keys/index', [ 'sshKeys' => SshKeyResource::collection(user()->sshKeys()->simplePaginate(config('web.pagination_size'))), ]); } #[Get('/json', name: 'ssh-keys.json')] public function json(): ResourceCollection { $this->authorize('viewAny', SshKey::class); return SshKeyResource::collection(user()->sshKeys()->get()); } #[Post('/', name: 'ssh-keys.store')] public function store(Request $request): RedirectResponse { $this->authorize('create', SshKey::class); app(CreateSshKey::class)->create(user(), $request->input()); return back()->with('success', 'SSH key created.'); } #[Delete('/{sshKey}', name: 'ssh-keys.destroy')] public function destroy(SshKey $sshKey): RedirectResponse { $this->authorize('delete', $sshKey); $sshKey->delete(); return back()->with('success', 'SSH key deleted.'); } }