New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

patinthehat/laravel-repositories

Laravel 5 Repository classes
12 1

Larablocks Analysis

patinthehat/laravel-repositories works with any PHP project: the latest release (v1.0.1, Apr 1, 2017) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Apr 1, 2017)
  • 0 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Apr 1, 2017.
  • No releases in the last 12 months.
  • First released: Apr 1, 2017.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.

Install
composer require patinthehat/laravel-repositories
Latest Version:v1.0.1
PHP:>=5.6.4
License:MIT
Last Updated:Apr 1, 2017
Links: GitHub  ·  Packagist
Maintainer: patinthehat

Laravel Repositories


This package provides a basic Repository pattern implementation for use with Laravel 5+.

Installation


This package may be installed with composer:

composer require patinthehat/laravel-repositories

Usage


Extend the Repository class and define its model method to create a repository for that model:

use Permafrost\Repository;

class UserRepository extends Repository
{
    public static function model()
    {
        return 'App\\User';
    }
}

The repository can then be used:

  $user = UserRepository::findByFirstName('john');

Dynamic Find Methods


The Repository class allows for dynamic findByN/findAllByN method calls, which will search the repository model's field N for its first argument. For example,

    UserRepository::findByFirstName('john')

results in a call to

    User::where('first_name', 'john')->first()

License


This package is open source software, available under the MIT license. See LICENSE for more information.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP License
v1.0.1 >=5.6.4 MIT
v1.0.0 >=5.6.4 MIT