Download the PHP package wimski/laravel-model-repositories without Composer

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

Latest Stable Version Coverage Status PHPUnit PHPStan

Laravel Model Repositories

Generic repository pattern for Laravel Eloquent models.

Changelog

View the changelog.

Usage

Install package

Setup service provider

This package is NOT loaded using package discovery. You should create your own service provider that extends the one from this package and add it to your config manually.

app/Providers/RepositoryServiceProvider.php

config/app.php

Generate a repository

This will create the following files:

The namespace and file location depend on the namespace configuration.

Alternatively you can completely override the contract and repository FQN by using the command options. The namespace matching and class name suffixing will be skipped.

Add repository binding

Set up the binding of your new repository in the service provider.

Example usage

Publishing configuration file

Because this package does not register its own service provider, your own service provider should be referenced when publishing this package's configuration file.

Namespace configuration

The namespaces configuration is used to determine what the namespaces of your repository classes - and locations of the subsequent files - should be. Each configuration exists of three parts:

When generating a repository for a model the command will look for a namespace configuration which has a models part that matches the supplied model. The contracts and repositories parts of that configuration are then used as the namespaces for the repository classes.

Assumptions

Default configuration

When generating a repository for App\Models\MyModel, the following two classes will be created:

Multiple configurations

You can have multiple namespace configurations, for example when using domains.

Specificity

The first match will be used so if you have overlapping namespace configurations, make sure to have the more specific ones on top.

Available methods

See interface.

Stub customization

See Laravel's documentation about stub customization. This package adds the following stub files:

PHPUnit

PHPStan

Credits

License

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


All versions of laravel-model-repositories with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework 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 wimski/laravel-model-repositories contains the following files

Loading the files please wait ....