Download the PHP package mrtolouei/laravel-repository without Composer

On this page you can find all versions of the php package mrtolouei/laravel-repository. 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-repository

Laravel Repository

A clean and flexible base repository package for Laravel that simplifies data access, enforces the Repository Pattern, and keeps your application code organized, testable, and maintainable.

This package provides a reusable BaseRepository implementation with common Eloquent operations and a powerful filtering system.

Tests Latest Stable Version


Table of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Basic Usage
  5. Available Methods
  6. Filtering System
  7. Query Builder & Chainable Methods
  8. Persisting Queries
  9. CRUD Operations
  10. Advanced Usage
  11. Testing
  12. Contributing
  13. License

Features


Requirements


Installation

No configuration or service provider registration is required.


Basic Usage

Create a repository for your model by extending the BaseRepository.

Example Model

Create Repository


Available Methods

The BaseRepository provides many commonly used data access methods.

Create

Find

Update

Delete

Restore (Soft Deletes)

Insert Multiple

Where

OR Where

Where In

Where Not In

Order

Limit

Pagination

Aggregate Functions

Existence Check


Filtering System

The package includes a powerful filtering trait that allows structured filtering from arrays (useful for APIs).

Only fields listed in $allowedFilters can be filtered.

Example

Supported Operators

Keyword SQL Equivalent
eq =
neq !=
gt >
gte >=
lt <
lte <=
like LIKE
in IN (...)

Using Filters

Example usage in a controller:

Example filter input (from query parameters or request body):

Explanation


Query Builder & Chainable Methods

All major query methods remain chainable:

Method Description Example
query() Get Builder instance $userRepo->query()->where('active', true);
where(...) Add where clause (supports array and closure) $repo->where(['status' => 'active']);
with([...]) Eager load relations $repo->with(['posts', 'roles']);
orderBy() Add order clause $repo->orderBy('created_at', 'desc');
limit() Limit results $repo->limit(10)->all();

Persisting Queries

Preserve query state across multiple operations:

Without calling persistQuery(), queries auto‑reset after each operation.


CRUD Operations


Advanced Usage

Powerful nested filter combinations with chaining:


Testing

Run tests using PHPUnit:


Contributing

  1. Fork the repository
  2. Create a feature branch (feature/awesome-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/awesome-feature)
  5. Open a Pull Request

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-repository with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version >=9.0
illuminate/database Version >=9.0
illuminate/pagination Version >=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 mrtolouei/laravel-repository contains the following files

Loading the files please wait ...