So I have done the following: I have a table called group that has longitude and latitude which is essentially a location of the group. Then I have an append which calculates the distance from the user. Group Model: What I want to do now is USE that distance from user in a where clause like below in a scope,
Tag: laravel
How to create and secure multi-auth api gurds using laravel 8 passport?
I’m building an API for android app which requires 2 types of authentication using Laravel 8. Users Auth and Teachers Auth. The problem that I have is that tokens which are created for users can be …
How do I authenticate a user in Laravel 8 Jetstream only if his status is active?
I am building a Laravel 8 application and have successfully implemented authentication. Now I want to check if a user’s status is active before logging him in. I have added a field in the users table I am using JetStream and Fortify Thank You Answer You can customize user authentication from appProvider…
Laravel, only first element of array passed to route is readable
From a blade template I want to pass an array with a variable amount of values to a route, as described in the answer here. However when I do this I can only ever access the first value in the array I …
Confirm delete using sweetalert in Laravel Form Collective
I’m a beginner in using laravel, please help. I’m using sweet alert to ask for confirmation before deleting. The error says that it is missing a required parameter for destroy, though I am certainly sure that I am passing an id to the function destroy. Here’s my code Announcement.blade.php d…
Laravel does not read .env variables when there is a # character
In Laravel 7 when I do a simple: the output is always: And my .env file is: I am waiting for a response : “Secret: 123#456#789”. And don’t understand why I receive only “Secret: 123”. I know it is a trivial question, but I am on this problem… Thanks Answer # is used to decl…
Deploying Laravel app to Google App Engine
I am trying to deploy my Laravel 7.29.3 app to Google App Engine Standard environment. I have followed the guided located here https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard. However, I get a View[Welcome] not found error when I view my deployment. My app.yaml file looks like b…
Laravel: Passing data into route from database
I have created a theme system and I am trying to make the theme’s route file pull pages from the database and assign a route to it, below is my theme route file. The issue I am having is an Undefined variable: theme from my ThemeSettings::all model request. Route.php (In theme) ThemeSettings Migration T…
How to display link delete to auth user in Laravel?
I’m having a simple message/comment features. The message can be deleted by using SoftDeletes function in Laravel. However, I want to make the message can be deleted or the link message being display by the logged-in user only. They cannot delete other’s message. So, here is my code in message.bla…
query don´t show one result
i have this query: i can show my result, but always don´t show all, i want to say that if my result it´s 3 my query show 2 when all my result have the same result. all data have state=”pendiente” table user table asistencia table actuacion table contratan i attached my migration for you can show m…