README.md 1023 Bytes
Newer Older
Angel MAS committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
# Package products OneStartup

  **onestartup/product** is a module product for websites

# Installation

- Run this in the terminal

```php
composer require onestartup/product
```

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

```php
Onestartup\Product\ProductServiceProvider::class,
```

- Run migration

```php
php artisan migrate
```

- add next lines to app/User.php

```php
public function products()
{
    return $this->hasMany('Onestartup\Product\Model\Product', 'user_id');
}
```

- run command for publish views

```php
php artisan vendor:publish --provider="Onestartup\Product\ProductServiceProvider"
```

- run command for publish config file

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

- run serv

```php
php artisan serve
```

- test in this route how admin user

```php
http://localhost:8000/admin/product/product
```
- add .env vars
```php
SLUG_PRODUCTS=productos
SLUG_PRODUCTS_CATEGORY=categorias
```

- test in this route 

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