Recommend this page to a friend! |
Classes of Nahid Bin Azhar | PHP StackExchange API | README.md | Download |
|
Downloadphp-stack-apiphp-stack-api is a php SDK for StackExchange api version 2.2. Now you can easily access and hanlde all of StackApps Apis. Lets enjoy :) Requirements
InstallationTo install this package with your project, just run this command in your terminal from project root.
ConfigurationsAfter installation complete successfully, you have to configure it correctly. This package is also Laravel compatible. LaravelOpen
and then run this command in your terminal to publish config file
When you run this command
Pure PHP ProjectThere are no special configuration for pure PHP project. You have to pass configuration data when the class is instantiated.
UsageIts has a lots of functionalities. When all of these are configured, you just use it like what you what. At first you need to authenticate an user with your project. So make a authentication link.
Its make a authentication url for StackExchange and get Get Currently Authenticated Users DataAPI URI: For Laravel
Pure PHP
Users Information By User IDAPI URI: For Laravel
Pure PHP
Here all of these data are Objects. So you can easily handle it. The Easy WayThis package is well formatted as like as RestAPI URI. Really you amazed to see it. For example, you want to get data where URI is
Or, if the URI is
> Note: 1. every URI you can call as PHP method chaining as per URI format. > 2. If you have a hyphen (-) separated URI, it will transform to camel case(camelCase) when you called as a method > 3. Every URI parameter goes to method parameter as per URI format. Here the final example, if you have a URI like
Available Methods
For more about StackApps API you can read documentation Thank you :) |