0
したがって、単一のコントローラとメソッドを呼び出すAPIエンドポイント/api/v1/xxx
があります。私はcomposer install
を実行する場合を除きLaravel 5.4:ログインしたユーザーまたはログアウトしたユーザーに基づいてルートを作成する最良の方法
if (Auth::guard('api')->guest()) {
Route::post('xxx', 'API\v1\[email protected]');
} else {
Route::post('xxx', 'API\v1\[email protected]')->middleware('auth:api');
}
すべての作品次のロジックを追加したroutes/api.php
で
は、私は次のエラーを取得:
[email protected] /var/www/html/test/app13 $ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
[LogicException]
Key path "file:///var/www/html/test/app13/storage/oauth-public.key" does not exist or is not readable
Script php artisan optimize handling the post-install-cmd event returned with error code 1
routes/api.php
で行を削除すると、出力しないこと^ composer install
を実行するとエラーが発生します。
私は間違っていますか?
ありがとうございました。
このルートを有効にしてphp artisanコマンドを実行することはできません。 – Phantom007
これはもっと簡単です。これらの行をコメントし、php artisan passportを実行します。インストールして、これらの行のコメントを外してコンポーザーをインストールします。 – rummykhan
私はこれが可能な解決策であるとは思わない。その多くは「ジャガード」だ。 – Phantom007