258 questions
0
votes
1
answer
116
views
Laravel API returning HTML instead of JSON when served via NGINX
I’m running a Laravel backend alongside a Vue frontend on NGINX. The issue I’m facing is that my API endpoints are returning HTML instead of JSON. For example:
https://isuecampusmap.site/api/ → ...
2
votes
1
answer
81
views
how to load relation from relation in laravel api resource
I am playing for the first time with API Resource in laravel 12.
I have this situation:
The product has many Skus:
public function skus(): HasMany
{
return $this->hasMany(Sku::class);
}
The ...
0
votes
1
answer
84
views
laravel passport use pkce and approve manulay oauth/authorize
Hello I want to create an authentication system using API with oauth2 pkce and I don't want to use the laravel UI. What suggestions do you have so that I can manually provide the authentication key?
1....
0
votes
0
answers
71
views
Should I Use NextAuth.js for Authentication with a Laravel API in a Next.js (SSR) E-Commerce Site?
I'm building an SEO-friendly e-commerce site. Since I usually work with Inertia.js, React, and Laravel as an SPA (which isn't ideal for SEO), I’ve decided to use Next.js with Server-Side Rendering (...
0
votes
1
answer
46
views
Laravel API and React Frontend: Redirecting to Profile After Submitting Post Results in 404 | Not Found
I have built a web application where the front end is created using React and the backend with Laravel. My application setup is as follows:
Frontend (React): Hosted on the main domain: https://...
3
votes
1
answer
80
views
Issue with ::put and ::delete Method in Laravel API - 404 Error Instead of JSON Response
I am developing a Laravel API and am encountering issues with my ::put method. I can successfully create and retrieve a model, but when I attempt to delete or update, I receive Laravel's 404 page ...
1
vote
0
answers
84
views
In Laravel 11 how can I get the Review data to be displayed in a paginated fashion while still using ReviewCollection?
I've got the following in a App\Http\Resources\V1\BookResource.php that I would like to paginate.
"reviews" => new ReviewCollection(
$this->reviews()
->where("...
1
vote
0
answers
114
views
Laravel Appending Request Body to Response with 200 Status Code
I am getting an issue on hitting the Laravel API. The following issue occurs:
The API is hit and returns an incorrect response twice, with the request body being appended along with a 200 status code. ...
2
votes
1
answer
643
views
How to separate categories in JSON with Laravel Resource API
I was trying to build an API with Laravel but I failed to categories data from a table.
The API JSON should look like this:
[
{
id: 1,
name: 'John Doe',
birth_place: 'Birmingham',
...
0
votes
1
answer
337
views
problem with routes API laravel in cPanel
A few days ago I uploaded my laravel project to my hosting with my test domain, in cPanel.
There I could see that my vue components were not loading, I did not see the data tables, etc..
Searching, I ...
0
votes
1
answer
443
views
Laravel 11 - Executing php artisan install:api is giving "Symfony\Component\Process\Exception\ProcessStartFailedException"
I set up a new Laravel 11 project and try to install API routes by executing php artisan install:api command.
This results in the below error.
Laravel install api error
OS: Mac OS Sonoma 14.3.1 (23D60)...
0
votes
0
answers
42
views
Target class does not exist when I'm trying to acces API route
When I'm trying to access my route via http://localhost:8000/api/dnd/array, I get error:
Target class [Api/DndController] does not exist.
https://flareapp.io/share/87ndNRBm
I've use these commands to ...
-1
votes
1
answer
48
views
Reorganizing controller files in Laravel
In Laravel, I can't find my controller after rearranging the file and folder structure in app/http/controller. I wanted to organize my controller files due to their large number. Here's how it looks ...
0
votes
0
answers
58
views
API Call to your own Laravel Project
I am struggling to make an API call to my project. Can someone assist me here?
This is the command I am entering:
curl.exe -X PUT http://hsk.local/api/v1/applicants/1 \ -H "Content-Type: ...
1
vote
1
answer
1k
views
Error 419 (unknown status) CSRF token mismatch. | Laravel Sanctum + Fortify + Vue SPA
I get a "419 (unknown status)" error when sending a post request to login user
POST http://localhost/login 419 (unknown status)
Network request response : "message": "CSRF ...