Skip to content

Commit 75cb6b2

Browse files
committed
Initial commit
0 parents  commit 75cb6b2

File tree

11 files changed

+1362
-0
lines changed

11 files changed

+1362
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
vendor/
3+
composer.lock
4+
composer.phar

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Vitalik Kravchyshyn
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Laravel Repositories
2+
Laravel Repositories to abstract the database layer.

composer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "freevital/laravel-repository",
3+
"description": "Laravel 5 Repositories",
4+
"keywords": ["laravel", "repository", "eloquent", "model"],
5+
"authors": [
6+
{
7+
"name": "Vitaliy Kravchyshyn",
8+
"email": "vital.kravchyshyn@gmail.com"
9+
}
10+
],
11+
"support": {
12+
"email": "vital.kravchyshyn@gmail.com",
13+
"issues":"https://github.com/freevital/laravel-repository/issues",
14+
"wiki":"https://github.com/freevital/laravel-repository",
15+
"source":"https://github.com/freevital/laravel-repository"
16+
},
17+
"type": "library",
18+
"require": {
19+
"illuminate/container": "~5.0",
20+
"illuminate/database": "~5.0",
21+
"illuminate/support": "~5.0",
22+
"illuminate/console": "~5.0"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Freevital\\Repository\\": "src/"
27+
}
28+
},
29+
"license": "MIT",
30+
"minimum-stability": "dev",
31+
"prefer-stable": true
32+
}

config/repository.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Pagination Default Limit
8+
|--------------------------------------------------------------------------
9+
|
10+
*/
11+
'pagination' => [
12+
'limit' => 15
13+
]
14+
];

src/Contracts/CriteriaContract.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Freevital\Repository\Contracts;
4+
5+
use Illuminate\Database\Eloquent\Builder;
6+
7+
interface CriteriaContract
8+
{
9+
/**
10+
* Apply criteria in query repository.
11+
*
12+
* @param Builder $query
13+
* @param RepositoryContract $repository
14+
*
15+
* @return mixed
16+
*/
17+
public function apply(Builder $query, RepositoryContract $repository);
18+
}

0 commit comments

Comments
 (0)