README.md 1016 Bytes
Newer Older
Pancholin committed
1 2
# Package products OneStartup

Pancholin committed
3
  **onestartup/product_resources** is a module product for websites
Pancholin committed
4 5 6 7 8 9

# Installation

- Run this in the terminal

```php
Pancholin committed
10
composer require onestartup/product_resources
Pancholin committed
11 12 13 14 15
```

- after add the ServiceProvider to the providers array in config/app.php

```php
Pancholin committed
16
Onestartup\ProductResource\ProductResourceServiceProvider::class
Pancholin committed
17 18 19 20 21 22 23 24 25 26 27
```

- Run migration

```php
php artisan migrate
```

- add next lines to app/User.php

```php
Pancholin committed
28
public function productsResource()
Pancholin committed
29
{
Pancholin committed
30
    return $this->hasMany('Onestartup\Product\Model\ProductResource', 'user_id');
Pancholin committed
31 32 33 34 35 36 37 38 39
}
```

- run command for publish views

```php
php artisan vendor:publish --provider="Onestartup\ProductResource\ProductResourceServiceProvider"
```

Francisco Salazar committed
40 41 42 43 44 45
- run command for publish config file

```php
php artisan vendor:publish --tag=config 
```

Pancholin committed
46 47 48 49 50 51 52 53 54
- run serv

```php
php artisan serve
```

- test in this route how admin user

```php
Pancholin committed
55
http://localhost:8000/admin/product_resources/products
Pancholin committed
56 57 58 59 60 61 62
```

- test in this route 

```php
http://localhost:8000/portafolio
```