A collection of classes to be extended/used in laravel apps for quick development

Overview

laraquick

A collection of classes to be extended/used in laravel applications for quick development.

Introduction

The library contains traits with well documented methods that should be used by controllers and models to enhance coding speed.

Installation

composer require d-scribe/laraquick

Dependencies

>= v1.*

  • PHP >= 7.0
  • Laravel - ~5.5
  • Guzzle - ~6.0

v0.*

  • PHP >= 5.6.0
  • Laravel - 5.4.*
  • Laravel Fractal - ^4.0
  • Guzzle - ~6.0

Example

An example controller for a Book model is:

use App\Book;
use Laraquick\Controllers\Traits\Api;

class BookController extends Controller {

    use Api;

    protected function model() {
        return Book::class;
    }

    protected function validationRules(array $data, $id = null) {
        return [
            'title' => 'required|max:200',
            'author' => 'required|max:50',
            'genre' => 'required'
        ];
    }
}

And with just the above, the controller would take care of listing (w/ pagination), and all CRUD operations and give the right JSON responses.

Route::apiResource('books', 'BookController');

What if Web and not API?

Oh, that's covered too with the version 1.5 and above. Just swap out the Api trait for its Web counterpart, and you're good.

Documentation

Get a full walk-through

Contribution

Contributions are absolutely welcome. Create a PR and I'll as swiftly as possible merge it up.

You might also like...
A quick and incomplete example of how to validate a form using a FormValidator class on the simple-mvc
A quick and incomplete example of how to validate a form using a FormValidator class on the simple-mvc

Simple MVC Description This repository is a simple PHP MVC structure from scratch. It uses some cool vendors/libraries such as Twig and Grumphp. For t

Create a downloads list - quick and easy. With categories and mobile friendly design
Create a downloads list - quick and easy. With categories and mobile friendly design

Simple downloads list plugin for wordpress Create a downloads list - quick and easy. With categories and mobile friendly design What is Simple downloa

A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.
A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the CoinDCX API and allows you to easily communicate with it. Important Note This package is in early deve

 Ignition: a beautiful error page for Laravel apps
Ignition: a beautiful error page for Laravel apps

Ignition is a beautiful and customizable error page for Laravel applications running on Laravel 5.5 and newer. It is the default error page for all Laravel 6 applications.

 Manage self-hosted Google Fonts in Laravel apps
Manage self-hosted Google Fonts in Laravel apps

This package makes self-hosting Google Fonts as frictionless as possible for Laravel users. To load fonts in your application, register a Google Fonts embed URL and load it with the @googlefonts Blade directive.

Automatically disable Google's FLoC in Laravel apps
Automatically disable Google's FLoC in Laravel apps

Automatically disable Google's FLoC in Laravel apps This package will automatically disable Google's FLoC. Support us We invest a lot of resources int

Add Server-Timing header information from within your Laravel apps.
Add Server-Timing header information from within your Laravel apps.

Laravel Server Timings Add Server-Timing header information from within your Laravel apps. Installation You can install the package via composer: comp

A Docker container for Laravel web apps

Ubuntu Docker container for Laravel web applications Docker-laravel is a LEMP image for running Laravel web applications. It extends docker-base, whic

Postier is a Laravel API automation platform to transfer data and to sync apps.
Postier is a Laravel API automation platform to transfer data and to sync apps.

Postier is a Laravel API automation platform to transfer data and to sync apps. You can build workflows with data and actions of multiple apps and apply logics to the data!

Comments
  • Update composer.json

    Update composer.json

    Laravel doesn't follow semver. So having ^5.x, 5.* or >=5.x will mean that composer will install a future version even though that version breaks the package.

    opened by Dylan-DPC-zz 0
Releases(v3.3.2)
Owner
Ezra Obiwale
Do it well and fast if it's at all worth doing.
Ezra Obiwale
Collection of classes you can use to standardize data formats in your Laravel application.

Laravel Formatters This package is a collection of classes you can use to standardize data formats in your Laravel application. It uses the Service Co

Michael Rubel 88 Dec 23, 2022
PHP components - collection of cross-project PHP classes

PHP components Collection of cross-project PHP classes. Install: $ composer require ansas/php-component Ansas\Component\Convert\ConvertPrice Convert "

null 1 Jan 5, 2022
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
A collection of extensions for Laravel development in Visual Studio Code

Laravel Extension Pack for Visual Studio Code Includes the basic extensions to get started with Laravel development in Visual Studio Code. Laravel Ext

Winnie Lin 24 Dec 25, 2022
This package provides extended support for our spatie/enum package in Laravel.

Laravel support for spatie/enum This package provides extended support for our spatie/enum package in Laravel. Installation You can install the packag

Spatie 264 Dec 23, 2022
An extended laravel eloquent WHERE method to work with sql LIKE operator.

Laravel Eloquent WhereLike An extended laravel eloquent WHERE method to work with sql LIKE operator. Inspiration The idea of this package comes from o

Touhidur Rahman 33 Aug 6, 2022
Scout Extended: The Full Power of Algolia in Laravel

Documentation • Community Forum • Stack Overflow • Report a bug • FAQ • Support To dig right in, visit the Scout Extended documentation. Scout Extende

Algolia 378 Dec 1, 2022
A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm for each semester. All this served as a website.

Timetable-System-Generator A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm

null 3 Nov 19, 2022
A premade, easy to use local development setup to be used for authoring Laravel applications

Laravel Drydock This project is a premade, easy to use local development setup to be used for authoring Laravel applications. The deliverables of this

Alexander Trauzzi 19 Nov 11, 2022
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

Novath Thomas 1 Dec 1, 2021