Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

CloudyCity/laravel-builder-macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Builder Macros

Latest Version on Packagist Software License StyleCI Quality Score Total Downloads

Installation

Require this package with composer using the following command:

composer require cloudycity/laravel-builder-macros

After updating composer, add the service provider to the providers array in config/app.php

CloudyCity\LaravelBuilderMacros\Providers\DatabaseServiceProvider::class,

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Requirement

  • PHP 5.6 +

Usage

$query->insertUpdate($data);
// INSERT INTO TABLE ... VALUES ... ON DUPLICATE KEY UPDATE ...

$query->replace($data);
// REPLACE INTO TABLE ... VALUES ...

$query->insertIgnore($data);
// INSERT IGNORE INTO TABLE ... VALUES ...

$query->whereIntegerInRaw('uid', ['1', '2'])->get();
// for the old version

License

MIT

About

A set of useful macros for your Query Builder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages