Skip to content

Commit 2e167ff

Browse files
committed
Update Readme.md
1 parent fbc5360 commit 2e167ff

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

Readme.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
# Database Repository
22

3-
## Install
3+
## Installation
4+
Use following command to add this package to composer development requirement.
45
```bash
5-
composer require nanvaie/database-repository
6+
composer require nanvaie/database-repository --dev
7+
```
8+
9+
### Setup for Laravel
10+
Navigate to `app.php` in `config` folder and add following line in 'provider' section:
11+
```php
12+
Nanvaie\DatabaseRepository\DatabaseRepositoryServiceProvider::class
13+
```
14+
15+
### Setup for Lumen
16+
Navigate to `app.php` in `bootstrap` folder and add following line after config registrations:
17+
```php
18+
$this->register->config('')
19+
```
20+
21+
Note: Make sure to run `composer dump-autoload` after these changes.
22+
23+
## Usage
24+
List of artisan commands:
25+
26+
| Command | Inputs | Options | Description |
27+
|-------------------------------------|-------------|------------|-----------------------------------|
28+
| `command:make-entity` | table_name | -f, -d, -k | Create new Entity |
29+
| `command:make-factory` | table_name | -f, -d | Create new Factory |
30+
| `command:make-resource` | table_name | -f, -d, -k | Create new Resource |
31+
| `command:make-interface-repository` | table_name | -f, -d, -k | Create new Repository Interface |
32+
| `command:make-repository` | table_name | -f, -d | Create new Base Repository |
33+
| `command:make-mysql-repository` | table_name | -f, -d, -k | Create new MySql Repository class |
34+
| `command:make-redis-repository` | table_name | -f, -d, -k | Create new Redis Repository class |
35+
| `command:make-all-repository` | table_names | -f, -d, -k | Run all of the above commands |
36+
37+
Example 1. Create new Entity for a table named 'users'.
38+
```bash
39+
php artisan command:make-entity users
40+
```
41+
42+
Example 2. Create all necessary classes for two tables named 'users' and 'customers' with enabled foreign key option.
43+
```bash
44+
php artisan command:make-all-repository users,customers
645
```

0 commit comments

Comments
 (0)