258 questions
0
votes
0
answers
490
views
Flutter download file from laravel : HandshakeException: Handshake error in client
I made a flutter program to download pdf files from laravel. I get an error when I press the download button.
Exception has occurred.
HandshakeException (HandshakeException: Handshake error in client (...
1
vote
0
answers
2k
views
Laravel simple request is toooooo slow
I have a problem: When trying to get a single user from the database using laravel controller response is just too slow. Response time is over 1000ms, see Postman screenshot below.
Below is my code:
...
0
votes
0
answers
861
views
Laravel 7 JSON Response comes out empty
I don't really understand why but whenever I reach this point on my code, the result is blank/empty on Postman
//check if user exists based on email
$userExistanceCheck = $this->...
3
votes
2
answers
604
views
ResourceController - BulkDelete
Recently I watched "Cruddy by Design" - Laracon US 2017 and now I'm trying to get rid of any extra methods in my controllers (so I only have index, create, store, show, edit, update and ...
1
vote
0
answers
159
views
laravel passport generate token in db transaction
i want to create a new user and generate password grant token inside a db transaction like this :
$createdUser= DB::transaction(function () use ($request) {
$createdUser=$this->userService-...
0
votes
1
answer
2k
views
Can´t fetch data from laravel api by react JS - status of 419 (unknown status), postman working
I am trying to get data from laravel api by fetching it. In postman it`s working even with authorization with sanctum.
When I fetch with post method it gives:
Failed to load resource: the server ...
-1
votes
1
answer
1k
views
How to Get data from an API every 2 min and use it in all of project?
I want to build a website which need to get gold price every 3 min and use with this price in many of my controller in my project.
how can get gold price from another API and how use this in my ...
1
vote
2
answers
1k
views
Laravel-API using session issue: Auth::id() is null
We are trying to access current logged user's id, We modified the auth.php file in this way:
'api' => [
'driver' => 'session',
'provider' => 'users',
],
and after this we ...
2
votes
1
answer
814
views
Deployed Laravel sanctum application not working anymore
I use sanctum for my vue Axios operations. I deploy to my shared hosting and I get this error in the chrome console:
GET http://foo.xyz/city 401 (Unauthorized)
bootstrap.js :
window._ = require('...
0
votes
1
answer
1k
views
Laravel API: validate doesn't access the PUT request data in my API
Context
I am implementing a user information update using a PUT request in Laravel 8. I use Postman to send the request and see the results.
Expected behavior
My PUT request reaches the controller's ...
-1
votes
1
answer
313
views
413 Payload Too Large in ionic api calling
I'm new to ionic. I am trying to make app in ionic and api's in laravel. I am trying to send base64 in body but it's giving me 413 Payload Too Large. If i don't send base64 then it's retuning 201 ...
0
votes
1
answer
2k
views
Laravel Spatie Permissions Get a user resource with their roles and permissions
I am writing because I have spent hours of testing looking for a solution to a problem and I still have not found how to solve it. I am using Spatie Laravel Permission and it happens that I have 3 ...
0
votes
0
answers
98
views
API Authentication issue
I'm working on creating APIs for the first time using laravel, please excuse me if I mention anything incorrect and let me know how to correct it.
I have followed this article to create API ...
3
votes
0
answers
553
views
Message "CSRF token mismatch." While using Laravel sanctum token API. Laravel 8
I am trying to build an API using Laravel sanctum token-based authentication. On postman, it works fine, and giving the desired output but for VueApp or any server running app, it is giving me an ...
0
votes
1
answer
193
views
Upload Image Using Laravel Api with Auth Token Passport
I have uploaded an image from the postman with form-data using passport token. but it gave me an error.
How can I solve this problem. I have tried all solutions but it can't work.
Header with Bearer ...
2
votes
1
answer
274
views
Using Sanctum with Laravel Spark conflict
My setup
Laravel 8
Laravel Spark Mollie
I'm constantly hitting a brick wall when calling API requests with Spark & Sanctum. I've installed Sanctum with no problem and migrated.
I've added use ...
2
votes
2
answers
614
views
How to change api_token parameter to some custom parameter like api_key or key
I have a Laravel application using API token authentication. By default, the user needs to pass the api_token parameter as part of the URL, but I want to change api_token to a custom name parameter ...
0
votes
1
answer
654
views
Laravel API DB transaction with too long code. How do I modularize or optimize this code? (I am new to Laravel)
I have very complex functions in laravel APIs ( called from Mobile App).
The sample function is given below.
If someone can help to improve the code structure.
I wish to know the best practices in ...
0
votes
1
answer
261
views
Intervention Image with Laravel Resource API
Is it possible to return a image created on the fly with Laravel API Resources without saving it?
Tried in controller
$sum = Product::where('slug', $product)->first();
$img = Image::make('...
0
votes
2
answers
763
views
Making a delete request using Axios to Laravel API throws an error but works fine in insomnia
Hi I am creating a web app using create-react-app which consumes endpoints developed in laravel 5.
When I make a Delete request using axios to the server, I get this error Cross-Origin Request Blocked:...
2
votes
1
answer
3k
views
Laravel: How to check user auth for API routes without middleware('auth:api')
how can i check if the current user accessing a method from a controller is authenticated,
the API route in question is not guarded by any authentication middle, because the route is accessible to ...
0
votes
1
answer
410
views
Why my laravel Passport Auth not working in browser?
I have a new laravel application with Passport authentication. my code for login works perfectly in my insomnia application.
Login:
public function login(Request $request)
{
if(Auth::attempt(['...
1
vote
1
answer
8k
views
How to operate the GET method with parameters in Swagger?
I'm using Swagger to do the documentation of the Laravel API's, and sometimes there is also testing apart from POSTMAN, the issue is that the GET methods with parameters do not work Route::get('/...
0
votes
0
answers
946
views
Laravel is not accepting GET API request without any parameter
I am making APIs in Laravel version 8.x for a third party system. For this, I have created few APIs and all routes are mentioned in routes/api.php
In our system, there are few APIs that can be ...
2
votes
1
answer
17k
views
Property [id] does not exist on the Eloquent builder instance
I am trying to get comment and it's replies in laravel api,I tried following way and faced to this error, how can I solve it?
this is my controller:
public function postSinglePage(Request $request)
{
...