Skip to content

Commit d8c0124

Browse files
committed
refactor
1 parent c6e848a commit d8c0124

File tree

117 files changed

+1220
-1186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1220
-1186
lines changed

.styleci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Styleci for WebDevEtc.
1+
# Styleci for BINSHOPS.
22

33
preset: laravel
44

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Hessam.
3+
Copyright (c) 2020 BINSHOPS.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+105-68
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,100 @@
1-
<p align="center"><a href="cms.binshops.com/" target="_blank"><img src="https://cms.binshops.com/img/hessam-cms.png"></a></p>
1+
# Laravel Blog
2+
Single version of Binshops Laravel Blog
23

3-
<p align="center">
4-
<a href="https://packagist.org/packages/hessam/laravel-blogger">
5-
<img src="https://poser.pugx.org/hessam/laravel-blogger/v/stable.png" alt="Latest Stable Version">
6-
</a>
4+
### Contact us for any customization:
5+
76

8-
<a href="https://packagist.org/packages/hessam/laravel-blogger">
9-
<img src="https://poser.pugx.org/hessam/laravel-blogger/license.png" alt="License">
10-
</a>
11-
</p>
7+
### Lightweight and Comprehensive
128

13-
# Complete Laravel CMS Package
14-
- ### Multi-level Categories
15-
- ### Full text search
16-
- ### Multi-language support (coming soon)
17-
- See the progress for multi-lang in `multi-lang` branch
9+
Incredible features with a lightweight laravel blog package. I highly recommend it because:
10+
- Quick installation (<3 minutes)
11+
- It's very easy to extend
12+
- Included great features out-of-box
13+
- Its simplicity allows to be easily made compatible with latest laravel
14+
- No additional concept except laravel knowledge
15+
- Compatible with other Laravel platforms like Bagisto
1816

19-
## [Let's try it - Online Demo](https://cms.binshops.com/login)
20-
You can try Hessam CMS online: [https://cms.binshops.com](https://cms.binshops.com/login)
17+
## Outstanding Features
18+
- Fulltext Search - search throughout all blog posts
19+
- Multi Level Category - nested sets using Baum
20+
- Multi Language Support
2121

2222
### Quick and easy installation
23+
1- Install via composer
2324

24-
Install with following command and follow the instructions.
25+
`composer require binshops/laravel-blog`
2526

26-
composer require hessam/laravel-blogger
27+
For a fresh Laravel installation run the following too:
2728

28-
### For Complete Setup Instructions (with video guide), please Visit [The Install Guide](https://hessam.binshops.com/laravel-blog-package#setup)
29+
```
30+
composer require laravel/ui
31+
php artisan ui vue --auth
32+
```
2933

30-
To see package on Packagist click this [Link](https://packagist.org/packages/hessam/laravel-blogger)
34+
2- Run the following two commands to copy config file, migration files, and view files
35+
36+
`php artisan vendor:publish --provider="BinshopsBlog\BinshopsBlogServiceProvider"`
37+
38+
3- Execute migrations to create tables
39+
40+
`php artisan migrate;`
41+
42+
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
43+
44+
```
45+
/**
46+
* Enter your own logic (e.g. if ($this->id === 1) to
47+
* enable this user to be able to add/edit blog posts
48+
*
49+
* @return bool - true = they can edit / manage blog posts,
50+
* false = they have no access to the blog admin panel
51+
*/
52+
public function canManageBinshopsBlogPosts()
53+
{
54+
// Enter the logic needed for your app.
55+
// Maybe you can just hardcode in a user id that you
56+
// know is always an admin ID?
57+
58+
if ( $this->id === 1
59+
&& $this->email === "your_admin_user@your_site.com"
60+
){
61+
62+
// return true so this user CAN edit/post/delete
63+
// blog posts (and post any HTML/JS)
64+
65+
return true;
66+
}
67+
68+
// otherwise return false, so they have no access
69+
// to the admin panel (but can still view posts)
70+
71+
return false;
72+
}
73+
```
74+
75+
5- Create a directory in `public/` named `blog_images`
76+
77+
6- Login as admin and setup your package: `/blog_admin/setup`
78+
79+
Congrats! Your blog is ready to use. (URLs are customizable in the config file)
80+
81+
Admin panel URI: `/blog_admin`
82+
Front URI: `/en/blog`
83+
84+
To see package on Packagist click this [Link](https://packagist.org/packages/binshops/laravel-blog)
85+
86+
### Bagisto version
87+
To see the Bagisto version of this package go to `bagisto-compatible` branch
3188

3289
## Important Notes
33-
- For laravel 8.x's default auth User model, change user model in `blogetc.php` to: `\App\Models\User::class`
90+
- For laravel 8.x's default auth User model, change user model in `binshopsblog.php` to: `\App\Models\User::class`
3491

3592
## Features
3693
- Compatible with latest laravel version (laravel 8.x)
3794
- Backward-compatibility with previous laravel versions
3895
- Full text search - searching throughout the blog posts
3996
- Multi-level category support
40-
- fully configurable via its `config/blogetc.php` config file
97+
- fully configurable via its `config/binshopsblog.php` config file
4198
- Ready to use admin panel
4299
- Full customizability of admin views and front views
43100
- Paginated views
@@ -46,56 +103,34 @@ To see package on Packagist click this [Link](https://packagist.org/packages/hes
46103
- Managing comments and comment approval
47104
- Other options include using Disqus comments or disabling comments
48105

49-
## Recent Changes
50-
- **8.0.x** Compatibility with Laravel 8.x
51-
52-
## Screen Shots
53-
54-
<p align="center">
55-
<img src="https://hessam.binshops.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-08-at-6.23.35-PM-1024x560.png" width="500px" title="Add post">
56-
</p>
57-
<p align="center">
58-
Add post
59-
</p>
60-
61-
<p align="center">
62-
<img src="https://hessam.binshops.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-08-at-6.19.42-PM-1024x558.png" width="500px" title="All posts">
63-
</p>
64-
<p align="center">
65-
All posts
66-
</p>
67-
68-
<p align="center">
69-
<img src="https://hessam.binshops.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-08-at-6.03.39-PM-1-1024x560.png" width="500px" title="Add category">
70-
</p>
71-
<p align="center">
72-
Add category
73-
</p>
74-
106+
## Recent Changes
107+
- **9.1.x** Multi language support
108+
- 8.0.x Compatibility with Laravel 8.x
109+
75110
## What/who this package is for:
76111

77-
- For websites running Laravel
78-
- Who wants to have a site blog, and have an easy to use interface to write blog posts/assign categories/manage existing posts
79-
- Where only admin users can edit/manage the blog (this is not suitable for every user on your site to be able to manage posts)
80-
- For anyone who likes to add a wordpress-like CMS to her/his web app
112+
- For websites running Laravel
113+
- Who wants to have a site blog. This laravel blog gives an easy to use interface to write blog posts/assign categories/manage existing posts
114+
- Where only admin users can edit/manage the blog (this is not suitable for every user on your site to be able to manage posts)
115+
- For anyone who likes to add a wordpress-like laravel blog to laravel website
81116

82117
## How to customise the blog views/templates
83118

84-
After doing the correct `vendor:publish`, all of the default template files will be found in /resources/views/vendor/blogetc/ and are easy to edit to match your needs.
119+
After doing the correct `vendor:publish`, all of the default template files will be found in /resources/views/vendor/binshopsblog/ and are easy to edit to match your needs.
85120

86121
### Customizing admin views
87122
If you need to customize the admin view, just copy the files from
88-
`vendor/webdevetc/blogetc/src/Views/blogetc_admin`
123+
`vendor/binshopsblog/src/Views/binshopsblog_admin`
89124
to
90-
`resources/views/vendor/blogetc_admin`
125+
`resources/views/vendor/binshopsblog_admin`
91126
Then you can modify them just like any other view file.
92127

93128
## Routes
94129

95-
It will auto set all required routes (both public facing, and admin backend). There are some config options (such as changing the /blog/ url to something else), which can be done in the blogetc.php file.
130+
It will auto set all required routes (both public facing, and admin backend). There are some config options (such as changing the /blog/ url to something else), which can be done in the binshopsblog.php file.
96131

97132
## Config options
98-
All config options have comments which describe what they do. Please just refer to the `blogetc.php` file in your /config/ dir.
133+
All config options have comments which describe what they do. Please just refer to the `binshopsblog.php` file in your /config/ dir.
99134

100135
### Custom User Model
101136
You can change the default user model through the config file.
@@ -110,7 +145,7 @@ Add these (and an Event Listener) to your `EventServiceProvider.php` file to mak
110145

111146
There is a built in captcha (anti spam comment) system built in, which will be easy for you to replace with your own implementation.
112147

113-
Please see [this Captcha docs](https://hessam.binshops.com/laravel-blog-package#captcha) for more details.
148+
Please see [this Captcha docs](https://binshops.binshops.com/laravel-blog-package#captcha) for more details.
114149

115150
## Image upload errors
116151

@@ -122,17 +157,19 @@ Try adding this to config/app.php:
122157
- Ensure that /public/blog_images (or whatever directory you set it to in the config) is writable by the server
123158
- You might need to set a higher memory limit, or upload smaller image files. This will depend on your server. I've used it to upload huge (10mb+) jpg images without problem, once the server was set up correctly to handle larger file uploads.
124159

125-
## Version History
126-
- **8.0.x** Compatibility with Laravel 8
160+
## Version History
161+
- **9.2.x** Stable version of package
162+
- 9.0.x Multi-language support beta release
163+
- 8.0.x Compatibility with Laravel 8
127164
- 7.3.2 Some bug fixes
128165
- 7.3.0 New Admin UI
129-
- 7.2.2
130-
- bug fix: do not show search bar when it's disabled
131-
- feature: configure to show full text post or preview
166+
- 7.2.2
167+
- bug fix: do not show search bar when it's disabled
168+
- feature: configure to show full text post or preview
132169
- 7.2.1 - adds logout button at admin panel
133-
- 7.2.0
134-
- adds sub-category functionality to blog
135-
- adds reading progress bar feature (if you upgrade, re-publish config file and view files)
170+
- 7.2.0
171+
- adds sub-category functionality to blog
172+
- adds reading progress bar feature (if you upgrade, re-publish config file and view files)
136173
- 7.1.8 - ability to remove images from posts (this feature does not work for old posts)
137174
- 7.1.7 - updates CKEditor
138175
- 7.1.5 - minor fix for recent posts
@@ -147,7 +184,7 @@ Try adding this to config/app.php:
147184
- 3.0.2 - fixed default medium image size (changed to 600x400)
148185
- 3.0.1 - replaced all short tags (<?) with full opening ones (<?php)
149186
- 3.0 - Added separate functionality for uploading images (and save some meta data in db)
150-
- 2.1 - added 'short_description' to db + form, and BlogEtcPost::generate_introduction() method will try and use this to generate intro text.
187+
- 2.1 - added 'short_description' to db + form, and BinshopsBlogPost::generate_introduction() method will try and use this to generate intro text.
151188
- 2.0 - added full text search (enable it via the config file - it is disabled by default).
152189
- 1.2 - added WYSIWYG, few smaller changes
153190
- 1.1.1 - added basic captcha
@@ -156,7 +193,7 @@ Try adding this to config/app.php:
156193
- 0.3 - Small changes, packagist settings.
157194
- 0.1 - Initial release
158195

159-
Contact: hessam.modaberi@gmail.com
196+
Contact: contact@binshops.com
160197

161198

162199

composer.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "hessam/laravel-blogger",
2+
"name": "binshops/laravel-blog",
33
"keywords": [
44
"laravel",
55
"blog",
@@ -12,26 +12,26 @@
1212
"posts",
1313
"news",
1414
"update",
15-
"hessam-blog"
15+
"laravel blog",
16+
"binshops"
1617
],
1718
"description": "Simple blog package (with admin panel) for Laravel (6.x and 7.x). Includes all views, controllers, routes and can add a blog to any existing Laravel app. Fully customisable blog (view, urls, and many other options). Includes image uploads and a pretty admin interface to manage your blog. Defaults to /blog but you can change it to anything.",
1819
"license": "MIT",
1920
"support": {
20-
"docs": "https://hessam.binshops.com/laravel-blog-package/"
21+
"docs": "https://github.com/binshops/laravel-blog"
2122
},
2223
"authors": [
2324
{
24-
"name": "Hessam",
25-
"homepage": "http://hessam.binshops.com",
26-
"role": "developer",
27-
"email": "hessam.modaberi@gmail.com"
25+
"name": "Binshops",
26+
"homepage": "https://github.com/binshops/laravel-blog",
27+
"role": "owner",
28+
"email": "contact@binshops.com"
2829
}
2930
],
3031
"require": {
3132
"cviebrock/eloquent-sluggable": "~8.0|~7.0|~6.0|~4.8|~4.7|~4.6|~4.5",
3233
"laravelium/feed": "~2.12.0|~3.0.0|3.1.*|v6.0.*|v7.0.*|v8.0.*",
3334
"intervention/image": "2.*",
34-
"swisnl/laravel-fulltext": "^0.20.0",
3535
"laravel/helpers": "^1.3"
3636
},
3737
"require-dev": {
@@ -41,18 +41,19 @@
4141
},
4242
"autoload": {
4343
"psr-4": {
44-
"WebDevEtc\\BlogEtc\\": "src"
44+
"BinshopsBlog\\": "src",
45+
"BinshopsBlog\\Laravel\\Fulltext\\": "src/FulltextSearch/src/"
4546
}
4647
},
4748
"autoload-dev": {
4849
"psr-4": {
49-
"WebDevEtc\\BlogEtc\\Tests\\": "tests"
50+
"BinshopsBlog\\Tests\\": "tests"
5051
}
5152
},
5253
"extra": {
5354
"laravel": {
5455
"providers": [
55-
"WebDevEtc\\BlogEtc\\BlogEtcServiceProvider"
56+
"BinshopsBlog\\BinshopsBlogServiceProvider"
5657
],
5758
"aliases": {
5859
}

migrations/2018_05_28_224023_create_blog_etc_posts_table.php renamed to migrations/2018_05_28_224023_create_binshops_blog_posts_table.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7-
class CreateBlogEtcPostsTable extends Migration
7+
class CreateBinshopsBlogPostsTable extends Migration
88
{
99
/**
1010
* Run the migrations.
@@ -13,7 +13,7 @@ class CreateBlogEtcPostsTable extends Migration
1313
*/
1414
public function up()
1515
{
16-
Schema::create('blog_etc_posts', function (Blueprint $table) {
16+
Schema::create('binshops_blog_posts', function (Blueprint $table) {
1717
$table->increments('id');
1818
$table->unsignedInteger("user_id")->index()->nullable();
1919
$table->string("slug")->unique();
@@ -35,7 +35,7 @@ public function up()
3535
$table->timestamps();
3636
});
3737

38-
Schema::create('blog_etc_categories', function (Blueprint $table) {
38+
Schema::create('binshops_blog_categories', function (Blueprint $table) {
3939
$table->increments('id');
4040

4141
$table->string("category_name")->nullable();
@@ -47,22 +47,22 @@ public function up()
4747
$table->timestamps();
4848
});
4949

50-
Schema::create('blog_etc_post_categories', function (Blueprint $table) {
50+
Schema::create('binshops_blog_post_categories', function (Blueprint $table) {
5151
$table->increments('id');
5252

53-
$table->unsignedInteger("blog_etc_post_id")->index();
54-
$table->foreign('blog_etc_post_id')->references('id')->on('blog_etc_posts')->onDelete("cascade");
53+
$table->unsignedInteger("binshops_blog_post_id")->index();
54+
$table->foreign('binshops_blog_post_id')->references('id')->on('binshops_blog_posts')->onDelete("cascade");
5555

56-
$table->unsignedInteger("blog_etc_category_id")->index();
57-
$table->foreign('blog_etc_category_id')->references('id')->on('blog_etc_categories')->onDelete("cascade");
56+
$table->unsignedInteger("binshops_blog_category_id")->index();
57+
$table->foreign('binshops_blog_category_id')->references('id')->on('binshops_blog_categories')->onDelete("cascade");
5858
});
5959

6060

61-
Schema::create('blog_etc_comments', function (Blueprint $table) {
61+
Schema::create('binshops_blog_comments', function (Blueprint $table) {
6262
$table->increments('id');
6363

64-
$table->unsignedInteger("blog_etc_post_id")->index();
65-
$table->foreign('blog_etc_post_id')->references('id')->on('blog_etc_posts')->onDelete("cascade");
64+
$table->unsignedInteger("binshops_blog_post_id")->index();
65+
$table->foreign('binshops_blog_post_id')->references('id')->on('binshops_blog_posts')->onDelete("cascade");
6666
$table->unsignedInteger("user_id")->nullable()->index()->comment("if user was logged in");
6767

6868
$table->string("ip")->nullable()->comment("if enabled in the config file");
@@ -85,8 +85,8 @@ public function up()
8585
*/
8686
public function down()
8787
{
88-
Schema::dropIfExists('blog_etc_post_categories');
89-
Schema::dropIfExists('blog_etc_categories');
90-
Schema::dropIfExists('blog_etc_posts');
88+
Schema::dropIfExists('binshops_blog_post_categories');
89+
Schema::dropIfExists('binshops_blog_categories');
90+
Schema::dropIfExists('binshops_blog_posts');
9191
}
9292
}

0 commit comments

Comments
 (0)