grayloon / magento-laravel-api Goto Github PK
View Code? Open in Web Editor NEWA simple Magento 2 REST API Object Oriented wrapper for Laravel applications.
License: MIT License
A simple Magento 2 REST API Object Oriented wrapper for Laravel applications.
License: MIT License
Hi i think that would be best for use the wrapper if had the option of using the settings from constructor and not only from environment or laravel configs, by example:
public function __construct($baseUrl = null, $token = null, $version = null, $basePath = null, $storeCode = null)
{
$this->baseUrl = $baseUrl ?: config('magento.base_url');
$this->token = $token ?: config('magento.token');
$this->version = $version ?: config('magento.version') ?: 'V1';
$this->basePath = $basePath ?: config('magento.base_path') ?: 'rest';
$this->storeCode = $storeCode ?: config('magento.store_code') ?: 'all';
}
I'm having an issue updating to laravel 9
Problem 1
- illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.1.6) does not satisfy that requirement.
- illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.1.6) does not satisfy that requirement.
- Root composer.json requires grayloon/laravel-magento-api ^0.9.0 -> satisfiable by grayloon/laravel-magento-api[0.9.0, 0.9.1].
- Conclusion: don't install laravel/framework v9.0.0-beta.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.0-beta.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.0-beta.4 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.0-beta.5 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.1.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.2.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.3.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.3.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.4.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.4.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.5.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.5.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.6.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.7.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.8.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.8.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.9.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.10.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.10.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.11.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.12.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.12.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.12.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.13.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.14.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.14.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.15.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.16.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.17.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.18.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.19.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.20.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.4 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.5 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.21.6 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.22.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.22.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v9.0.0-beta.1 (conflict analysis result)
- grayloon/laravel-magento-api[0.9.0, ..., 0.9.1] require illuminate/support ^7.0|^8.0 -> satisfiable by illuminate/support[v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev].
- Only one of these can be installed: illuminate/support[dev-master, v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev], laravel/framework[v9.0.0-beta.1, ..., 9.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].
Helpful for IDE editors.
i am trying to make call using the "access token" but keep getting the error that i dont have access to the resources.
i see in the magento manual that a connection using only the token is disables by default
https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication-token.html
but there "fix" to enable "enable_integration_as_bearer" is also no good, that has also been removed.
they continue to imply we should us oauth, is that supported?
Hi Andy,
How to handle sku's with slashes (/)? Do I have to urlencode all the sku's before using an API endpoint or is there setting for this? Is the urlencoding only needed for the url or also for the Postdata?
Thanks!
Is there a way I can change an order status?
Hi everyone,
We have discontinued working with Magento in favor of other platforms. We are looking for maintainers to take over this package.
Interested? Drop a comment here or email me at [email protected].
Thanks!
We are upgrading to Magento 2.4.4 and authorization is not working in staging environment. Is this related to #86? Is there a workaround to use this package with Magento 2.4.4?
Thanks in advance for your help.
Hi, great wrapper!
I don't know how to load special prices for product
https://devdocs.magento.com/guides/v2.4/rest/modules/catalog-pricing.html#get-special-prices
I tried custom modules option (https://github.com/grayloon/magento-laravel-api#custom-modules), but I get the following error: Call to protected method Grayloon\Magento\Api\AbstractApi::post() from context 'App\Http\Controllers\WebhookController'
Thanks in advance for help!
example:
/V1/orders
Performs persist operations for a specified order.
Magento::api('orders')->edit($entity = []);
Using version ^0.4.1 for grayloon/laravel-magento-api
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1].
- Can only install one of: guzzlehttp/guzzle[7.1.1, 6.5.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1].
- grayloon/laravel-magento-api 0.4.1 requires guzzlehttp/guzzle ^6.0 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- Installation request for grayloon/laravel-magento-api ^0.4.1 -> satisfiable by grayloon/laravel-magento-api[0.4.1].
- Installation request for guzzlehttp/guzzle (locked at 7.1.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.1.1].
Grayloon\Magento\Magento::api is not a static method.
In magento_custom_attributes
type is size
, value is 1715
- Where we need to define ID 1715 (which is "L")
Proposal:
Current:
Attribute Type is the hard value string, Attribute Value is the hard value of "value" on the API.
New:
Attributes are resolved using Magento API /V1/products/attributes/{attributeCode}
.
magento_custom_attribute_types
magento_custom_attributes.attribute_type
becomes magento_custom_attribute_type.id
magento_custom_attribute_types.name
houses the type "name".magento_custom_attribute_types.options
has an json array value of potential options.magento_custom_attributes.value
becomes the truth value of an option resolved from magento_custom_attribute_types.options
. If the option is not available, use the hardcoded value from the APIAs the project grew, the documentation got a bit messy. The idea here would be to add a <dataset>
for each endpoint with an index to quickly navigate to the endpoint at the top of the readme.
Could we add a function similar to:
public function all_nopages($filters = [])
{
return $this->get('/orders',$filters);
}
to the Api/Orders class?
I'd like to get the raw data :)
Adopt the Laravel Facade, Magento::class
to use methods statically.
e.g.
Instead of:
$magento = new Magento();
$response = $magento->api('products')->all();
Use:
$magento = Magento::api('products')->all();
I want to create order from my admin on magento and this package does not have method for order create
$response = $magento->api('orders')->all($pageSize = 1, $currentPage = 1, $filters = ["created_at&searchCriteria[filter_groups][0][filters][0][value]=2016-07-01 00:00:00"]);
so i have tried almost everything I can think of to filter the data would you please explain the right way thanks
Hello.
I am trying to post categories to magento using laravel. I found that this post
, put
, delete
methods are protected. I can not use. Is there any other way? or why it is protected
$magento->api('categories')->post('/',$categoryArray);
/**
* Send a POST request with query parameters.
*
* @param string $path
* @param string $parameters
* @return \Illuminate\Http\Client\Response
*/
protected function post($path, $parameters = [])
{
return $this->checkExceptions(Http::withToken($this->magento->token)
->post($this->apiRequest.$path, $parameters), $this->apiRequest.$path, $parameters);
}
Call to undefined method Grayloon\Magento\Api\Orders::show()
https://flareapp.io/share/17WEXz8m#F44
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.