Download the PHP package surazdott/laravel-repository without Composer

On this page you can find all versions of the php package surazdott/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 Design Pattern

Introduction

Laravel Repository Design Pattern package provides an overview of the design pattern used in a Laravel service and repository structure. The primary goal of this pattern is to separate concerns, improve code organization, and enhance maintainability.

Repository Pattern Components

Get Started

Requires PHP 8.1+

First, install package via the Composer package manager:

Generating Classes

You can also generate repository class indivisually or can be generated with options.

Basic Commands

To find help and options

Basic usages

As the software development industry continues to evolve, there has been a focus on improving code maintainability, leading to modifications in design patterns.

Base Class

Let's look at a simple example:

Repository Interface

Make your initial repository interface first.

App\Repositories\Interfaces\UserRepositoryInterface.php

Repository Class

Use this command to create your first repository class.

App\Repositories\UserRepository.php

Service Class

Use the following command to create the service class after the interface and repository.

App\Service\UserService.php

Controller Class

Now create a Laravel controller file and use the service class as below.

App\Http\Controllers\UserController.php

Eloquent Query Builder

If you want to run eloquent queries, you can call the query() function to get an eloquent builder. Example: $this->users->query()->latest()->get();

Methods

Take a look at some of the methods in the following list.

create()

To insert a new record into the database, you should use create method.

find()

To get the first record from database records, you should use find method.

first()

To get the first record from database records, you should use first method.

findOrFail()

To find specific record from database records, you should use findOrFail method.

update()

To find specific record from database records, you should use update method.

delete()

To delete records from database, you should use delete method and pass integer, array or string.

query()

You can build the database builder by using the query method and run eloquent queries and model scopes.

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request. Contributions are welcome!

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.1
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 surazdott/laravel-repository contains the following files

Loading the files please wait ....