Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Commit

Permalink
added documentation for lumen and removed app_path helper to support …
Browse files Browse the repository at this point in the history
…lumen
  • Loading branch information
mistenkt committed May 18, 2017
1 parent 3e13bcc commit bf16d33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kodebyraaet Pattern for Laravel 5
# Kodebyraaet Pattern for Laravel 5 and Lumen

The base for the repository pattern we use in Kodebyraaet.

Expand All @@ -7,17 +7,21 @@ The base for the repository pattern we use in Kodebyraaet.
Install composer dependency.

composer require kodebyraaet/pattern
Add the Service Provider to the config/app.php file.

If you are using Laravel add the Service Provider to the config/app.php file.

Kodebyraaet\Pattern\BaseRepositoryServiceProvider::class,

If you are using Lumen add the Service Provider to the bootstrap/app.php file.

$app->register(Kodebyraaet\Pattern\BaseRepositoryServiceProvider::class);

### Create the base repositories

If you have the [Kodebyraaet Generators](https://github.com/Kodebyraaet/generators) installed you can just run the following command:

php artisan make:base-repository

Or you can do it manually:

##### Create the file `App\Entities\Repository.php` (the namespace may differ):
Expand All @@ -44,7 +48,7 @@ use Kodebyraaet\Pattern\BaseRepositoryInterface;

interface RepositoryInterface extends BaseRepositoryInterface
{

}
```

Expand Down
2 changes: 1 addition & 1 deletion src/BaseRepositoryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function register()
$namespace = $this->getAppNamespace();

// Get the Entity folder
$entityFolder = app_path('Entities');
$entityFolder = app('path').DIRECTORY_SEPARATOR.'Entities';

// Loop through all the folders in the Entity folder
foreach (glob($entityFolder.'/*', GLOB_ONLYDIR) as $folder) {
Expand Down

0 comments on commit bf16d33

Please sign in to comment.