piratepixelx/larapikit

LarapiKit is a versatile and robust Laravel API package designed to simplify and enhance your web application development process. With a focus on security time saving and easy integration, this package empowers developers to streamline their API-related tasks, saving time and effort.

v1.0.2 2023-10-05 15:20 UTC

This package is auto-updated.

Last update: 2025-05-05 19:11:22 UTC


README

Latest Stable Version Total Downloads License

Introduction

LarapiKit is a Laravel API package specifically crafted for sharing data from your Laravel website effortlessly using API keys. It simplifies the process of data sharing in Laravel applications, providing developers with time-saving, powerful security, easy integration, and an array of additional features.

Features

  • Effortless Data Sharing: Share data from your Laravel website seamlessly.
  • Robust Security: Ensures data remains secure through API key authentication.
  • Simplified Integration: Easily integrate LarapiKit into your Laravel projects.
  • Additional Features: Explore a range of supplementary functionalities to enhance your data sharing capabilities.

Requirements

  • PHP 7.4+
  • Laravel 8

Installation

You can install LarapiKit via Composer by executing the following command:

composer require piratepixelx/larapikit

Upon installation, you can publish the package configuration file by running:

php artisan vendor:publish --tag=larapi-config

Open the .env file in your Laravel project and add your API key like this in both websites same api key ('your_api_key'):

API_KEY=<your_api_key>

Configuration

Customize LarapiKit's behavior by modifying the configuration file located at config/larapi.php. This file contains settings for controlling various aspects of the package.

Usage

To effectively use LarapiKit in your Laravel application, refer to the provided examples and code snippets in the official documentation. These resources will guide you through the integration process and demonstrate the package's capabilities.

Example: Retrieving Data Using LarapiKit

To retrieve data from your Laravel API using LarapiKit and an API key, follow these steps:

    use GuzzleHttp\Client;

    // Replace with your actual API key
    $apiKey = config('app.api_key');

    // Create a HTTP client
    $client = new Client();

    // Send a GET request to the API endpoint
    $response = $client->request('GET', 'http://website.com/api-key-auth/api-data-will-share-from-here', [
        'headers' => [
            'Authorization' => $apiKey,
        ],
    ]);

    // Parse the response data
    $data = json_decode($response->getBody(), true);

    // Now, you can work with the retrieved data as needed.

Documentation

For comprehensive information and detailed usage instructions, please visit the official LarapiKit Github Repository.

Support

If you encounter any issues or have questions related to LarapiKit, don't hesitate to reach out. You can find assistance by following our support guidelines.

Contributing

We welcome contributions from the community. If you'd like to contribute to LarapiKit, please adhere to our contribution guidelines.

License

LarapiKit is open-source software distributed under the MIT.