Laravel アイコン写真の登録

Laravel

アイコン写真の登録

Jeststream公式リファレンスを参考に、config/jetstream.php で、該当箇所のコメントアウトを外し、アイコン写真を有効化。
https://jetstream.laravel.com/1.x/features/profile-management.html#profile-photos

config/jetstream.php

    'features' => [
        Features::termsAndPrivacyPolicy(),
        Features::profilePhotos(),
        Features::api(),
        Features::teams(['invitations' => true]),
        Features::accountDeletion(),
    ],

写真アップロード後、保存場所:

public\strage\profile-photos

シンボリックリンクをはる。

php artisan storage:link

エラーの場合は
Windows : publicフォルダを開き、storageを右クリック、削除
Linux系 : publicフォルダまで移動して、$ rm -rf storage

※画像がうまく表示されない場合
.envファイルを開いて、APP_URL を修正。

# APP_URL=http://localhost //これをコメントアウト、
APP_URL=http://127.0.0.1:8000 //追加。

本番環境の場合は本番環境のURLに合わせて変更する必要がある。

コメント