I’m trying to write a policy for this route: Route::delete( ‘users/{user}/locations/{location}’, [UserLocationController::class, ‘destroy’], )->middleware(‘can:delete,user,location’); but …
Tag: api
How to Return List of Project Tasks in ActiveCollab
Sorry this may be a trivial question but I am new to PHP. In the documentation to retrieve project tasks, the following code is provided to connect to an Active Collab cloud account: This works fine. I can then create a client to make API calls: and get the list of tasks for a given project as shown in the
Problem with update database from API in Laravel PHP
I have a database of items, now I need to update the pictures in 10,000 records in the database, I make an API request, I receive an answer, but I just cannot process the answer correctly. I received result: And i need compare the name, and write in database icon_url value. But always i received error: Undefined array key “items”
Trying to get property name and id of laravel payload
I have this JSON payload below and want to get names and ids from the payload. However, l cannot object names and ids from the payload. Decode JSON Api json payloads Answer Use json_decode to decode the json to an associative array, then access the elements of the array as you would any other assoc array. It looks as though
Bigcommerce cart 422: Missing required fields error
I’m using Laravel to consume the Bigcommerce V3 API. I have ben able to succesfully create a new cart. But when trying to add an item to it, I keep getting a 422: Missing required fields error. I’m making my request trough Guzzle like this: The product I’m trying to add has no options or modifiers, so I don’t understand
Basic question about REST APIs enpoint creation and access and how to create an app script
I’ve been recently learning about REST APIs (concretely using MySQL and PHP) so it’s hard for me to understand basic concepts since most of the sites I check have more advanced solutions. My doubt is the following: I know that an endpoint is the place where we get the data, but I’m not sure about the URI format, sometimes I’ve
Can’t perform a PHP POST request on mysql database
I’m struggling into do my first API in php and I’m facing some problems with a simple POST request. I’ve searched almost everywhere for some alternatives to my code, but it seems to be ok. Can you guys check it for me the last time? Thank you! method: create.php: Answer ok, so I managed to resolve with this code in
CS CART API Login Post URL
There is an auth attribute having 2 parameters, but it didn’t work http://example.com/api/auth?email=example@gmail.com The output of the URL is Also, the redirection_url parameter is not working. Please help me fix this. Answer You need to provide Auth Email Auth Password in Basic Oth in Postman
Error Message: “The GET method is not supported for this route. Supported methods: POST”
when i access to endpoint this http://localhost/newsapp_api/public/api/register,this message is showed “The GET method is not supported for this route. Supported methods: POST”. look to the …
Do someting if user does not interact after some time – PHP
I`m building a whatsapp bot, the bot is fully operational, but I want to do a API call if user does not interact with the api after some time. I tryed to do with session, but is not working, I tryed the following code. Answer Unfortunately for you, “any API” is purely “server side.” Therefore, it cannot “react” when anyone