Skip to content

Commit fac0deb

Browse files
committed
readme update
1 parent 8f5fc92 commit fac0deb

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,53 @@ Incredible features with a lightweight laravel blog package. I highly recommend
2020
- Multi Language Support
2121

2222
### Quick and easy installation
23-
23+
1- Install via composer
2424
`composer require binshops/laravel-blog`
25-
25+
For a fresh Laravel installation run the following too:
26+
```
27+
composer require laravel/ui
28+
php artisan ui vue --auth
29+
```
30+
2- Run the following two commands to copy config file, migration files, and view files
31+
`php artisan vendor:publish --provider="HessamCMS\HessamCMSServiceProvider"`
32+
3- Execute migrations to create tables
33+
`php artisan migrate;`
34+
4- You must add one method to your \App\User (in laravel 8 \App\Models\User) model. As the name of this method shows it determines which user can manage posts. Place your logic there
35+
```
36+
/**
37+
* Enter your own logic (e.g. if ($this->id === 1) to
38+
* enable this user to be able to add/edit blog posts
39+
*
40+
* @return bool - true = they can edit / manage blog posts,
41+
* false = they have no access to the blog admin panel
42+
*/
43+
public function canManageBinshopsBlogPosts()
44+
{
45+
// Enter the logic needed for your app.
46+
// Maybe you can just hardcode in a user id that you
47+
// know is always an admin ID?
48+
49+
if ( $this->id === 1
50+
&& $this->email === "your_admin_user@your_site.com"
51+
){
52+
53+
// return true so this user CAN edit/post/delete
54+
// blog posts (and post any HTML/JS)
55+
56+
return true;
57+
}
58+
59+
// otherwise return false, so they have no access
60+
// to the admin panel (but can still view posts)
61+
62+
return false;
63+
}
64+
```
65+
5- Create a directory in `public/` named `blog_images`
66+
6- Login as admin and setup your package: `/blog_admin/setup`
67+
- Congrats! Your blog is ready to use. (URLs are customizable in the config file)
68+
Admin panel URI: `/blog_admin`
69+
Front URI: `/en/blog`
2670

2771
To see package on Packagist click this [Link](https://packagist.org/packages/binshops/laravel-blog)
2872

0 commit comments

Comments
 (0)