Download the PHP
package nastuzzi-samy/laravel-query-selection without Composer
On this page you can find all versions of the php package
nastuzzi-samy/laravel-query-selection. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor nastuzzi-samy Package laravel-query-selection Short Description Add some custom scopes on models to make a better selection via requests License
MIT
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.
Informations about the package laravel-query-selection
laravel-query-selector
A Laravel package that add some custom scopes on models to make a better selection via requests
Installation
With composer
Docs
This trait add multiple scopes into model class
They are all usable directly by calling them (withtout the "scope" behind) when querying for items
To work correctly, the developer must define this property:
selection as a key/value array
=> the developer defines as selectors as (s)he wants, but a selector is only usable if it is defined as key
=> each key is a selector: paginate, week, order...
=> each value can be
a simple value (which is treated as like a default value)
an array with (if needed) a default key. Next, each selector as its column params
=> if the default value is null or it is not defined if the array, this means that the selector is optional
Usage
In your targeted model:
In your targeted controller:
Let think we got 11 users, the 11th is the latest
Example 1: request /api/users?paginate=5
Output:
Example 2: request /api/users?paginate=3&order=random
Output:
Custom: You can also use your custom scopes !!
If you have installed the nastuzzi-samy\laravel-model-stages for example
Usage example
In your targeted model:
In your targeted controller:
Let think we got a company tree with 1 Boss, 2 Supervisors and 4 Employees
Example 1: request /api/users?stage=0
Output:
Example 2: request /api/users?stage=0,1
Output:
Example 3: request /api/users?stage=2&order=random
Output:
All versions of laravel-query-selection with dependencies
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 nastuzzi-samy/laravel-query-selection contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.