258 questions
0
votes
1
answer
95
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/ → ...
0
votes
1
answer
73
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
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://...
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("...
2
votes
1
answer
636
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
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)...
-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 ...
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 ...
0
votes
1
answer
127
views
How to show response json of validation errors in Blade
I'm working with Laravel and this is my RegisterController Class based on API:
class RegisterController extends AuthController
{
public function register(Request $request)
{
$validator ...
0
votes
1
answer
3k
views
How to use stateful and stateless Laravel API Authentication
I'm currently building an API using Laravel and need two different authentication types and would just like some input on weather I'm thinking correctly before implementing everything.
The API will ...
1
vote
1
answer
46
views
Laravel API, communication between two web domain (main <- other). only accept for specific domain that allowed to requesst [duplicate]
Here I ask for implementation laravel API and Laravel APP communicating each other.
Here's how the flow supposed to be:
Laravel API side, can retrieve all request from outside that had account and ...
1
vote
0
answers
412
views
How to fetch all classes of a specific flight for the seat map with Amadeus APIs?
I am making a seat map for a flight using Amadeus APIs?
In the documentation there are two ways to fetch the seat map data,
https://developers.amadeus.com/self-service/category/flights/api-doc/seatmap-...
1
vote
1
answer
212
views
Middleware Not Functioning Only on API Routes in Laravel 9.19
I have set up a project and written some routes in the api.php route file. I created a middleware, registered the middleware in the Kernel.php file, and then implemented the middleware in the api.php ...
0
votes
1
answer
21
views
Reactive value not updating based on dependent value
I have a project of Roles and Permission in Laravel API based with Vue.js frontend. In Add Roles page if clicking the "All" checkbox, all roles are checked but no data appears in ...
0
votes
0
answers
201
views
Laravel - "The file failed to upload" on shared hosting
So im currently working on a simple REST API in Laravel. I have a post function which sends entered data to database and uploads one file. Everything works fine on local. Image is uploading to storage/...
0
votes
0
answers
59
views
Upload folder over laravel api using flutter
I want to upload a directory over laravel api without compressing the directory, I want to select the directory and upload it, is there any way to do it?
I searched too much for it but I didn't find ...
3
votes
2
answers
2k
views
Target Enum Type is not instantiable
I want to call a route which binds to parameter from the route which the enums have the enum type with a value of integer. However, after calling it I get error 500 with this error message Target [App\...
-1
votes
1
answer
85
views
Laravel API didn't return the desired output
Route::group(\['namespace' =\> 'API\\V1'\], function () {
Route::group(['prefix' => 'auth', 'namespace' => 'Auth'], function () {
Route::get('registration', [CustomerAuthController::...
0
votes
1
answer
676
views
Encounter CORS Policy from Reactjs to Laravel 8 api
I have API using laravel 8. This API was made each Module. Laravel API running in localhost port 8000. Then i have reactjs app running in localhost port 3000. If i access api by URL or Rest Client ...
2
votes
2
answers
2k
views
Using same controller for web route and api route?
I am working on building API and so far I've familiar with the web route.I was wondering can we share the same controller for both web and API.
I already have a controller file which is working for ...
0
votes
0
answers
908
views
pass data to another component vuejs 3 and composition API
I´m trying to send data to my component table when i clicked a button. My another component should fill a table with data received. i´m using composition API. To try this i´m building this code:
in my ...
4
votes
3
answers
4k
views
Object of type Illuminate\Auth\AuthManager is not callable [closed]
As part of API development, I use Laravel 9 and use "php-open-source-saver/jwt-auth" package for authentication without tokens. The API works fine, but I get an error when I add the ...
0
votes
1
answer
39
views
Json key format change in laravel
I created API like this Json response.
{
"product_category_id": 1,
"branch_id": 1,
"product_category_code": "00184050",
"...
0
votes
0
answers
50
views
I am trying to get driver related to vehicle using vue js
I have shown vechicle data just I want to get driver data related to vehicle but unfortuntly i am getting error undefined please help me how can i show into draggablelist thank u ?
Controller
public ...
1
vote
1
answer
508
views
Get and post data in flutter with API from Laravel [duplicate]
Can anyone show me how to get and post data with API in flutter? I have tried some flutter API tutorials with Laravel but when I print the value is error cors, something wrong with my flutter code or ...