Download the PHP package propaysystems/laravel-base-repositories without Composer

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

Propay Systems

Base elequent repositories with interfaces for common queries.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

UNDER DEVELOPMENT AND TESTING - WE WILL ADD PROPER DOCUMENTATION WITH v1 STABLE RELEASE

This is the base classes & helper commands for the repository pattern we use. In your own repository classes you have to extend the BaseRepository and implement your custom interface. In your custom interface you have to extend the BaseRepositoryInterface. This will give you a collection of commonly used queries and function that you don't need to duplicate each time.

Requirements

PHP 8.0+ \ Laravel 8+

Version Compatibility

Laravel BaseRepositories
8.x 0.0.7
9.x 0.0.3
10.x 0.0.8

Installation

You can install the package via composer:

You can publish the config file with:

Configuration

We create the service and repositories in the app folder of laravel to make use of laravels auto loading functionality.

Service

The default path for createing services will be in the App\Services folder. If the folder does not exist it will be created.

If you want to overwrite default path for the service you can add a ENV variable and specify your custom path.

The base name that will be appended to the class that is created by default, it will append Service. So if you create a User -s service the file that gets created will be UserService

Repository

The default path for createing repositories will be in the App\Repositories folder. If the folder does not exist it will be created.

If you want to overwrite default path for the repository you can add a ENV variable and specify your custom path.

The base name that will be appended to the class that is created by default, it will append Repository. So if you create a User -r service the file that gets created will be UserRepository & UserRepositoryInterface

Usage

Creating a Service

The service class is where all the domain logic will be created. This makes it easier to reuse business logic in the controllers, API, commands etc

  1. Creating a service class:

Running this command will create a new service class in the App\Services\ folders.

The rule is to split every service into its own related folders so the above command will actually create a file in:

Injecting a Repository

:grey_exclamation: Remember to dependancy inject your repositories you want to use into the __construct method of your service like the example below.

Creating a Repository

  1. Creating a repository class:

Running this command will create a repository class with its related interface in the App\Repositories & App\Repository\UserRepository\Interfaces folder. Specifying the model with auto link the relevant model to the repository. In this case the User model will be added to the construct methof of the repository.

Same as the service class the rule is to split each repository into its own related folders so the above command will create files in:

This will also try create and register the class and interface in laravel.

:grey_exclamation: These command flags can be combined -s -r so that the related service and repository classes be created in one command.

First Repository

After creating your first repository a RepositoryServiceProvider.php file will automatically be created in your App\Providers folder. You will need to add the repository provider file to your config/app.php under the providers section. This will tell laravel that you are adding repositories and linking interfaces to them and they be autoloaded.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-base-repositories with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
spatie/laravel-package-tools Version ^1.9.2
illuminate/contracts Version ^11.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 propaysystems/laravel-base-repositories contains the following files

Loading the files please wait ....