Download the PHP package manchenkoff/laravel-repositories without Composer

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

Laravel Repositories

Packagist Version Packagist Downloads Packagist License Packagist Dependency Version

Package provides a basic implementation of Repository pattern with artisan command to generate classes.

Features:

Installation

To install this package, you need to install Composer first, and then run:

or add this line to composer.json:

and run composer update in the terminal.

Package should automatically register its service provider in your application, but you can do it manually in config/app.php:

Usage

First of all, you need to create a model class for your repository. You can do it manually or use artisan command:

Then you can create a repository class for your model:

This command will create a repository class in app/Repositories directory and PostRepositoryInterface contract class in app/Contracts/Repositories.

Now you can use existing methods in your services or extend with custom functionality:

Implementation

All repository methods use protected query() method to get Eloquent\Builder instance. You can override this method in your repository class to add custom logic, e.g. when you always need some relations to be loaded or custom sorting applied.

Here is a list of available methods with a quick description:

Method Description
paginated(): LengthAwarePaginator returns paginated collection
all(): Collection returns all entities
find(mixed $id): ?Model returns entity by id or null
get(mixed $id): Model returns entity by id or throws ModelNotFoundException
create(array $data): Model creates new entity with given data
update(Model $entity, array $data): Model updates existing entity with given data
updateMany(array $ids, array $data): void updates many entities with given data by ids
delete(Model $entity): Model deletes existing entity
deleteMany(array $ids): void deletes many entities by ids

Also you might want to adjust class template for your needs. You can do it by publishing package views:

Development

This package is completely open-source, so any contributions are welcome!

Clone this repository to your local machine, install dependencies and run tests:

There are some useful composer scripts:

Script Description
composer fmt Apply Laravel Pint code style rules
composer test Run tests with Testbench package
composer lint Run PHP Stan analysis against package codebase
composer rector Run Rector analysis against package codebase
composer rector:fix Apply available Rector suggestions

All versions of laravel-repositories with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.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 manchenkoff/laravel-repositories contains the following files

Loading the files please wait ....