Download the PHP package protonemedia/laravel-eloquent-where-not without Composer

On this page you can find all versions of the php package protonemedia/laravel-eloquent-where-not. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-eloquent-where-not

Laravel Eloquent Where Not

Latest Version on Packagist run-tests Quality Score Total Downloads Buy us a tree

Included in Laravel 9.2.0!

As of Laravel 9.2.0, you may use the native whereNot method. This package will be maintained for some time for Laravel 8 users but will be deprecated eventually.

📺 Want to see this package in action? Join the live stream on December 10 at 13:30 CET: https://youtu.be/fAY75SLQj3w

Support this package!

❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider sponsoring the maintenance and development. Keeping track of issues and pull requests takes time, but we're happy to help!

Laravel Splade

Did you hear about Laravel Splade? 🤩

It's the magic of Inertia.js with the simplicity of Blade. Splade provides a super easy way to build Single Page Applications using Blade templates. Besides that magic SPA-feeling, it comes with more than ten components to sparkle your app and make it interactive, all without ever leaving Blade.

Requirements

This package is tested with GitHub Actions using MySQL 5.7, PostgreSQL 10.8 and SQLite.

Features

Related package: Laravel Eloquent Scope as Select

Blogpost

If you want to know more about the background of this package, please read the blogpost: Apply the opposite of your Eloquent scope to the Query Builder with a Laravel package.

Installation

You can install the package via composer:

Add the macro to the query builder, for example, in your AppServiceProvider. By default, the name of the macro is whereNot, but you can customize it with the first parameter of the addMacro method.

Short API description

For a more practical explanation, check out the usage section below.

Call the whereNot method with a Closure:

The example above can be shortened by using a string, which should be the name of the scope:

You can use an array to call multiple scopes:

Use an associative array to call dynamic scopes:

If your dynamic scopes require multiple arguments, you can use an associative array:

You can also mix dynamic and non-dynmaic scopes:

Usage

Imagine you have a Post Eloquent model with a query scope that constraints the query to all posts that should make the front page.

Now you can fetch all posts for your front page by calling the scope method on the query:

But what if you want to fetch all posts that didn't make the front page? Using the power of this package, you can re-use your scope!

With short closures, a feature which was introduced in PHP 7.4, this can be even shorter:

Shortcuts

Instead of using a Closure, there are some shortcuts you could use (see also: Short API description):

Using a string instead of a Closure:

Using an array instead of Closure, to support multiple scopes and dynamic scopes:

Testing

Changelog

Please see CHANGELOG for more information about what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Other Laravel packages

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Treeware

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.


All versions of laravel-eloquent-where-not with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0|^8.1
illuminate/support Version ^8.76|^9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package protonemedia/laravel-eloquent-where-not contains the following files

Loading the files please wait ....