Download the PHP package littlebug/laravel-repository without Composer

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

Progress Latest Stable Version Total Downloads Latest Unstable Version License GitHub stars GitHub issues GitHub forks Laravel

Usage of Repository

Introduction

laravel-repository provides the basic repository class for laravel model The package was made to provide more More external methods, and more friendly editor prompts; layering the code, repository is responsible for external business logic processing, model is only responsible for the definition of the fields, attributes, query conditions, and return values of the data table. It does not participate in specific logical operations, and does not serve the control layer.

Relative to the direct use of model advantages:

Install

Installation requirements

1.1 Install package

or add this to require section in your composer.json file:

then run composer update

1.2 Use the command to generate model and repository

Suppose you have users in your database, or you replace users with the table names in your database.

The command will be at:

1.3 Using repository in the controller

In addition to the injection method invocation described above, you can also use static method invocation; As follows:

1.4 Other common methods

Retrieve the data

method name return value description
find($conditions, $columns = ['*']) null\|array Querying individual data
findBy($conditions, $column) null\|mixed Query a single field for a single piece of data
findAll($conditions, $columns = ['*]) array Query multiple data
findAllBy($conditions, $column) array Querying a single field array of multiple data
first($conditions, $column) null\|model Retrieve a single model
get($conditions, $column) Collection Retrieve the collection

Statistical query

method name return value description
count($conditions, $column = '*') int The number of statistical
max($conditions, $column) mixed The maximum
min($conditions, $column) mixed The minimum value
avg($conditions, $column) mixed The average
sum($conditions, $column) mixed sum

Create or modify data

method name return value description
increment($conditions, $column, $amount = 1, $extra = []) int Since the increase
decrement($conditions, $column, $amount = 1, $extra = []) int Since the reduction of
firstOrCreate(array $attributes, array $value = []) model The query does not exist so create
updateOrCreate(array $attributes, array $value = []) model Modifications do not exist so create

1.5 More documentation

Please check more about repository

More code generation commands

Commands support specifying database connections such as --table=dev.users

  1. core:model generates model class files and repository class files by querying database table information.

  2. core:repository generates the repository class file

  3. core:request generates request verification class file by querying database table information

Command Parameter Details

commands of generate code

thanks for jinxing.liu and seven 💐🌹

if my repository is helpful to you, give me a star to encourage me~ ✨, I will continue to maintain this project.


All versions of laravel-repository with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
ext-json Version *
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 littlebug/laravel-repository contains the following files

Loading the files please wait ....