README.md 818 Bytes
Newer Older
Angel MAS committed
1 2 3 4 5 6 7
# Package blog OneStartup

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

# Installation

- Run this in the terminal
Angel MAS committed
8

Angel MAS committed
9 10 11
```php
composer require onestartup/blog
```
Angel MAS committed
12

Angel MAS committed
13
- after add the ServiceProvider to the providers array in config/app.php
Angel MAS committed
14

Angel MAS committed
15 16
```php
Onestartup\Blog\BlogServiceProvider::class,
Angel MAS committed
17
```
Angel MAS committed
18

Angel MAS committed
19
- Run migration
Angel MAS committed
20

Angel MAS committed
21 22 23
```php
php artisan migrate
```
Angel MAS committed
24

Angel MAS committed
25
- add next lines to app/User.php
Angel MAS committed
26

Angel MAS committed
27 28 29 30 31 32
```php
public function entries()
{
    return $this->hasMany('Onestartup\Blog\Model\Entry', 'user_id');
}
```
Angel MAS committed
33

Angel MAS committed
34
- run command for publish views and select  [7 ] Provider: Onestartup\Blog\BlogServiceProvider
Angel MAS committed
35

Angel MAS committed
36 37 38
```php
php artisan vendor:publish
```
Angel MAS committed
39

Angel MAS committed
40
- run serv
Angel MAS committed
41

Angel MAS committed
42 43 44
```php
php artisan serve
```
Angel MAS committed
45

Angel MAS committed
46
- test in this route how admin user
Angel MAS committed
47

Angel MAS committed
48 49 50
```php
http://localhost:8000/admin/blog/entry
```
Angel MAS committed
51

Angel MAS committed
52
- test in this route 
Angel MAS committed
53

Angel MAS committed
54 55 56
```php
http://localhost:8000/blog
```