2017 © Pedro PelĂĄez
 

library exists

Run exists queries in Laravel

image

marwelln/exists

Run exists queries in Laravel

  • Friday, April 28, 2017
  • by Marwelln
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Installation

composer require marwelln/exists:~1.0

Usage

$exists = Marwelln\Exists::table('mytable')->where('statement', 'value')->check(); // true or false

$exists = (new Marwelln\Exists('mytable'))->where('statement', 'value')->check(); // true or false

Available methods

static table(string $table)

Sets the table we want to run EXISTS with. Can use constructor instead if wanted., (*1)

where(string $key, mixed $value, string $operator = '=') // WHERE key {$operator} value

whereBetween(string $key, string $field1, string $field2) // WHERE key BETWEEN field1 AND field2

whereNull(string $key) // WHERE key IS NULL

whereNotNull(string $key) // WHERE key IS NOT NULL

Add WHERE statements. This can be chained., (*2)

check()
// SELECT EXISTS(SELECT 1 FROM table WHERE statements) AS `exists`

Run the query. Will return true or false depending on if the row existed or not., (*3)

The Versions

28/04 2017

dev-master

9999999-dev

Run exists queries in Laravel

  Sources   Download

MIT

The Requires

 

by Martin MÄrtensson

28/04 2017

v1.0.1

1.0.1.0

Run exists queries in Laravel

  Sources   Download

MIT

The Requires

 

by Martin MÄrtensson

01/06 2016

v1.0.0

1.0.0.0

Run exists queries in Laravel

  Sources   Download

MIT

The Requires

 

by Martin MÄrtensson