API generator for Laravel 5

Related tags

Laravel Apify
Overview

Apify

API generator for Laravel 5

StyleCI StyleCI StyleCI

Apify Logo

Table Of Contents

Installation

To install apify use composer

Download

composer require consoletvs/apify

Add service provider & alias

Add the following service provider to the array in: config/app.php

ConsoleTVs\Apify\ApifyServiceProvider::class,

Publish the assets

php artisan vendor:publish

Configuration

To configure the package go to: config/apify.php

The default file have a valid example and it's documented, check it out, should look like this:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Prefix used to access the API
    |--------------------------------------------------------------------------
    */
    'prefix' => 'apify',

    /*
    |--------------------------------------------------------------------------
    | Enables or disabled the whole API endpoints
    |--------------------------------------------------------------------------
    */
    'enabled' => true,

    /*
    |--------------------------------------------------------------------------
    | The tables enabled for the api and it's columns
    |--------------------------------------------------------------------------
    */
    'tables' => [

        // Specify all the tables below

        'users' => [

            // The columns from the table that will be displayed in the JSON

            'id', 'name', 'email', 'created_at', 'updated_at'

        ],

    ],
];

Usage

Visit the endpoint like this:

Website URL + /api/ + Prefix + /{table}/{accessor?}/{data?}

table: is the table you want to look at, must be an index of the table array in the configuration.

accessor: is optional, and it's the colum to filter data.

data: is the data you're filtering, you can add multiple data separated with a ,

Note: Remember that all calls to the API goes first to the api middleware, if you need to modify the api throttle go to: App\Http\Kernel.php and modify the api throttle.

'api' => [
    'throttle:60,1',
    'bindings',
],

The 60 determines the max calls / minute.

The 1 determines the minutes to wait if the max calls are exceded.

Some examples:

http://localhost/web/Laralum3/public/api/apify/users (example URL)
{"users":[{"id":1,"name":"\u00c8rik Campobadal","email":"[email protected]","created_at":"2016-09-22 16:13:28","updated_at":"2016-10-02 11:18:25"},{"id":2,"name":"Second User","email":"[email protected]","created_at":"2016-09-21 16:13:28","updated_at":"2016-09-22 16:20:00"},{"id":3,"name":"Third User","email":"[email protected]","created_at":"2016-08-22 16:13:28","updated_at":"2016-09-22 16:20:00"}]}
http://localhost/web/Laralum3/public/api/apify/users/email/[email protected],[email protected] (example URL)
{"users":[{"id":1,"name":"\u00c8rik Campobadal","email":"[email protected]","created_at":"2016-09-22 16:13:28","updated_at":"2016-10-02 11:18:25"},{"id":3,"name":"Third User","email":"[email protected]","created_at":"2016-08-22 16:13:28","updated_at":"2016-09-22 16:20:00"}]}
You might also like...
Simple project to send bulk comma-separated emails using laravel and messenger module from quick admin panel generator.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Laravel generator with GUI. Generate crud / scaffold.
Laravel generator with GUI. Generate crud / scaffold.

Laravel generator with GUI. Generate crud / scaffold.

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! This package is cloned from ht

Laravel MiGator - Migrations Generator
Laravel MiGator - Migrations Generator

Laravel Migator A package that will allow developers to interactively generate schema migrations for a laravel application. It takes into account the

Barcode generator in PHP that is easy to use, non-bloated and framework independent.

PHP Barcode Generator This is an easy to use, non-bloated, framework independent, barcode generator in PHP. It creates SVG, PNG, JPG and HTML images,

The official Statamic 3 static site generator package

Statamic Static Site Generator Generate static sites with Statamic 3. Installation Install the package using Composer: composer require statamic/ssg

Generator-hedley - Scaffold a headless Drupal backend, Angular app client, and Behat tests

generator-hedley Scaffold a headless Drupal backend, Angular app client, and Behat tests Hedley is a yeoman generator that scaffolds a headless Drupal

🔹 Generator Template for 🙃 Phony Framework
🔹 Generator Template for 🙃 Phony Framework

🔹 Generator Template This repository contains the Generator Template for 🙃 Phony Framework. 🙃 Start generating fake data with 🙃 Phony Framework, v

PHP implementation of Nanoid, secure URL-friendly unique ID generator

Nanoid-php A tiny (179 bytes), secure URL-friendly unique string ID generator for JavaScript Safe. It uses cryptographically strong random APIs and gu

Releases(1.0)
Owner
Erik C. Forés
ICT Systems Engineer. Senior developer with years of experience on the web. I build and maintain a lot of libraries, frameworks and a programming language.
Erik C. Forés
Html menu generator for Laravel

Html Menu Generator for Laravel This is the Laravel version of our menu package adds some extras like convenience methods for generating URLs and macr

Spatie 813 Jan 4, 2023
A Laravel and Lumen Badges Generator

Laravel and Lumen Badge Generator That package is a easy wrapper to Badges/Poser. #Installing composer require vluzrmos/laravel-badge-poser Laravel co

Vagner Luz do Carmo 6 Jun 10, 2020
A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache.

Laravel OTP Introduction A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache. The ca

Lim Teck Wei 52 Sep 6, 2022
Laravel Livewire (TALL-stack) form generator with realtime validation, file uploads, array fields, blade form input components and more.

TALL-stack form generator Laravel Livewire, Tailwind forms with auto-generated views. Support Contributions Features This is not an admin panel genera

TinaH 622 Jan 2, 2023
Promotional Codes Generator for Laravel >5

laravel-promocodes Promocodes generator for Laravel 5.*. Trying to make the best package in this category. You are welcome to join the party, give me

Zura Gabievi 425 Dec 26, 2022
A Laravel Code Generator based on your Models using Blade Template Engine

Laravel Code Generator is a PHP Laravel Package that uses Blade template engine to generate code for you. The difference between other code generators

Victor Yoalli 59 Dec 5, 2022
Laravel 5 Model Factory Generator

Laravel 5 Model Factory Generator This package offers a lazy way to create a new model factory files, since Laravel (< 5.5) have no Artisan command to

Roni Yusuf Manalu 16 Feb 15, 2020
Scaffold generator for Laravel 5.x

Laravel 5.x Scaffold Generator Usage Step 1: Install Through Composer composer require 'laralib/l5scaffold' --dev Step 2: Add the Service Provider Op

null 315 Dec 8, 2022
Laravel 5 Barcode Generator

This is a barcode generation package inspired by https://github.com/tecnickcom/TCPDF. Actually, I use that package's underline classes for generating

Nuruzzaman Milon 1.1k Jan 6, 2023
Secret Phrase Generator for Laravel.

Secret Phrase Generator for Laravel It generates secret pass phrase for Laravel Auth System. Require "require": { "php": "^7.3|^8.0",

null 2 Feb 21, 2022