D
D
DocTypeMaster2021-09-21 09:38:34
Laravel
DocTypeMaster, 2021-09-21 09:38:34

How to check the existence of data in a database table in inertia js laravel?

Friends, I tried to formulate a question for a long time, and if it is not entirely correct, then I'm sorry.

The bottom line is this, I connected Google Auth and I save the image that the user has on their Google account to the database, and upload it to the database. But when I tried to display this image, I noticed that the link there looks like this: " kbd/storage https://www.codecheef.org/public/editor/kcfinder/u... "

In a word, it is displayed with an extra part, but I can’t remove it otherwise if a link to the image that the user uploaded is displayed, then this path is needed there. Perhaps I need to create another variable that will pass the path precisely in the case when there is a Google ID or I don’t know how else to do it. But I also did not find the file where page.props.user.google_id is transmitted at all.

the code
<!-- Тут я проверяю есть ли данные в поле  google_id , и если они есть то хочу выводить изображение с ссылки-->
                <div v-if="$page.props.user.google_id">
                  <img class="rounded-circle" width="32" height="32" :src="$page.props.user.profile_photo_url" :alt="$page.props.user.name" />
                </div>
                  <!-- Если google_id нет значит выводить стандартную картинку которую генерирует вью аватар или же ту которуб загрузил пользователь-->
                <img v-else-if="$page.props.jetstream.managesProfilePhotos" class="rounded-circle" width="32" height="32" :src="$page.props.user.profile_photo_url" :alt="$page.props.user.name" />
                <!-- Тут если отключен модульт с аватаром то выводится нейм -->
                <span v-else>
                  {{ $page.props.user.name }}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DocTypeMaster, 2021-09-21
@DocTypeMaster

In general, I thought so and realized that it’s impossible to implement it this way, well, or you can’t do without a bunch of checks, as I understand it, it’s easier to save a photo that comes in the form of a link from Google to storage, as the default avatar loading system does, but I don’t know how upload a picture when I receive only a link to the image, if someone knows, tell me pliz

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question