Skip to content

fix mistake: author not rendered in single post view #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 144 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
4a63ffb
refactors and adds new tables for translation
samberrry Oct 16, 2020
2c6c8ad
model classes refactor
samberrry Oct 16, 2020
1eec6fc
adds relations to model classes
samberrry Oct 17, 2020
31bf65f
controller classes name refactor
samberrry Oct 17, 2020
54f05a0
adds language support for category
samberrry Oct 20, 2020
89ba9de
adds language controller and add language blade view
samberrry Oct 20, 2020
573c07a
multi language support for categories
samberrry Oct 22, 2020
7486983
adds hessam configuration
samberrry Oct 22, 2020
7dd151a
add language functionality
samberrry Oct 24, 2020
3c44ee4
partial multi lang post
samberrry Oct 28, 2020
30fcb37
completes suport for add post - translation
samberrry Nov 3, 2020
98c2a32
category update for multi lang support and some fixes on posts
samberrry Nov 5, 2020
6a82b1e
category hierarchy
samberrry Nov 5, 2020
9cdb16d
edit post multi language support
samberrry Nov 7, 2020
2dcad4c
remove post in multi-lang
samberrry Nov 7, 2020
8a68bb5
major view model controller - refactor
samberrry Nov 10, 2020
879f37c
some fixes
samberrry Nov 11, 2020
a3a63ee
changes category hierarchy ui
samberrry Nov 11, 2020
f079a4f
some bug fixes
samberrry Nov 13, 2020
af00ac5
made setup page ready for beta version
samberrry Nov 15, 2020
d1e317b
namespace refactor
samberrry Nov 15, 2020
f07d4d4
changes some links
samberrry Nov 16, 2020
dc3069b
adds language list to index page
samberrry Nov 16, 2020
097383f
Merge branch 'multi-lang'
samberrry Nov 16, 2020
8eda877
namespace fix
samberrry Nov 16, 2020
50b7ac9
fix for package removal
samberrry Nov 16, 2020
f1e4739
migeration name fix in provider
samberrry Nov 16, 2020
2ad5806
foreign key fix in migrations
samberrry Nov 16, 2020
dddc034
foreign key fix in migrations
samberrry Nov 16, 2020
7907230
foreign key fix in migrations
samberrry Nov 16, 2020
393b618
bug fix for pacakge setup
samberrry Nov 17, 2020
c826add
fix for setup controller
samberrry Nov 17, 2020
e41b071
fix for setup controller
samberrry Nov 17, 2020
cb28116
some bug fixes for setup section
samberrry Nov 17, 2020
08b8c24
changes setup page
samberrry Nov 17, 2020
50c9f16
bug fixes for loading default language in panel
samberrry Nov 17, 2020
3bd82bb
a fix for category translations
samberrry Nov 17, 2020
0cb0f97
Merge branch 'lates'
samberrry Nov 17, 2020
00b954d
url fix in edit post - panel
samberrry Nov 18, 2020
4e50019
readme update
samberrry Nov 18, 2020
24d2685
adds rtl to language
samberrry Nov 18, 2020
caf16bd
fix for remove photo and make is_published enbled by default
samberrry Nov 18, 2020
bde92ae
fix problem when storing multi lang post
samberrry Nov 19, 2020
d688995
fix for hessam configuration and setup page
samberrry Nov 20, 2020
6002775
full text search functionality
samberrry Nov 21, 2020
8cbd2cf
restrict for default language removal
samberrry Nov 21, 2020
dec14a8
readme update
samberrry Nov 21, 2020
c1ad155
fix for category hierarchy
samberrry Nov 21, 2020
a657bb7
category partial fix
samberrry Nov 21, 2020
3c34a61
some view fixes - and redirect to login if not logged in for setup
samberrry Nov 24, 2020
9df01d8
fix for search
samberrry Nov 24, 2020
0257d4a
readme update
samberrry Nov 24, 2020
35171d7
panel - bug fix in comment approval pacge
samberrry Nov 28, 2020
c183f81
readme change
samberrry Dec 1, 2020
f0a1a62
fix - comment migration
samberrry Dec 3, 2020
b521532
some fixes
samberrry Dec 4, 2020
af51391
some changes in setup page
samberrry Dec 4, 2020
22f7778
updates readme file
samberrry Dec 24, 2020
51f3b19
readme file update
samberrry Jan 2, 2021
41dee06
composer update
samberrry Jan 20, 2021
4f47a43
readme update
samberrry Jan 20, 2021
2b375d0
readme update
samberrry Jan 20, 2021
3ab12c2
fix for primary key for HessamConfiguration model
samberrry Jan 21, 2021
0062528
bug fix when removing featured image
samberrry Jan 29, 2021
781cca1
updates readme file
samberrry Jan 31, 2021
5ae4c90
updates readme file
samberrry Jan 31, 2021
a1af68a
readme update
samberrry Feb 5, 2021
27d79b8
fix for image_tag method
samberrry Feb 11, 2021
7ac30be
readme update
samberrry Feb 11, 2021
0a2f544
refactor
samberrry Mar 19, 2021
c3242c2
updates readme
samberrry Mar 19, 2021
763ab28
readme update
samberrry Mar 19, 2021
8f5fc92
readme update
samberrry Mar 19, 2021
fac0deb
readme update
samberrry Mar 19, 2021
10ef6b6
readme update
samberrry Mar 19, 2021
9128d10
readme update
samberrry Mar 19, 2021
254b4c3
readme update
samberrry Mar 19, 2021
2d984de
fix for adding new category
samberrry Mar 19, 2021
0868515
readme update for single language version
samberrry Mar 27, 2021
3952e9a
Fixes Needing to be a type array to return
edbrk Apr 3, 2021
06cfba0
Merge pull request #38 from Edbtvplays/patch-2
samberrry Apr 4, 2021
63ce823
updates readme
samberrry May 12, 2021
5808884
readme update
samberrry Oct 2, 2021
2ae7ab5
updates readme file
samberrry Oct 2, 2021
f8ca785
update readme
samberrry Oct 2, 2021
93259d3
fix for unpublished posts
samberrry Oct 18, 2021
b37d92f
Merge branch 'bugfix-publish' into develop
samberrry Oct 18, 2021
84e1ecc
Merge branch 'develop'
samberrry Oct 18, 2021
87261c7
fix for $category_slug parameter
samberrry Oct 22, 2021
981b17c
Merge branch 'develop'
samberrry Oct 22, 2021
667d166
readme update
samberrry Dec 2, 2021
326d259
readme update
samberrry Dec 3, 2021
f260593
setup page ui
samberrry Dec 14, 2021
74a2d1c
Merge branch 'develop'
samberrry Dec 14, 2021
b00d57c
setup page
samberrry Dec 14, 2021
d6cfe07
Merge branch 'develop'
samberrry Dec 14, 2021
eb31e81
readme
samberrry Dec 15, 2021
ba85bef
readme
samberrry Dec 15, 2021
906eb71
Resolve error on editing root level category
scs-ben Dec 23, 2021
08f2ef3
Fix paginator reference to use $posts->links()
scs-ben Dec 23, 2021
f8cb323
Merge remote-tracking branch 'scs-ben/master'
samberrry Dec 24, 2021
fd8cd7c
Merge branch 'master' into develop
samberrry Dec 24, 2021
29fd534
blog post categories
samberrry Dec 24, 2021
29b9e56
Merge branch 'develop'
samberrry Dec 24, 2021
3984200
Update BinshopsCommentWriterController.php
pravnkay Dec 30, 2021
d2839cb
Merge branch 'master' into develop
samberrry Dec 30, 2021
65837c5
url length exceeded fixed
usman-xs4arabia-dev Jan 13, 2022
d44d4a5
Merge pull request #65 from usman-xs4arabia-dev/master
samberrry Jan 13, 2022
2caaf26
readme update
samberrry Mar 12, 2022
0e1ac79
Merge branch 'master' into develop
samberrry Mar 12, 2022
81d51b9
Add files via upload
JustAnotherFalseProphet Mar 30, 2022
ed3ca30
Added the support for laravel 9, removed laravelium/feed
JustAnotherFalseProphet Mar 30, 2022
913eb86
removed a comma :(
JustAnotherFalseProphet Mar 30, 2022
41c2b77
Merge branch 'laravel9'
samberrry Apr 3, 2022
a94a1c4
Merge branch 'master' into develop
samberrry Apr 3, 2022
1a8fdae
removes laravelium feed package
samberrry Apr 3, 2022
4842bb2
Merge branch 'develop'
samberrry Apr 3, 2022
c786c6c
feat: adds new routes to routes, and adapts DetectLanguage logic
samberrry Apr 6, 2022
a46c7d8
refactor in getting route segments
samberrry Apr 6, 2022
a14f1dc
Additional instructions
nebucaz Aug 30, 2022
d79786d
Merge pull request #82 from nebucaz/master
samberrry Sep 16, 2022
8a90ae4
feat: added support for routes without locale
samberrry Dec 28, 2022
3b75cfb
Merge branch 'no-locale-route-support' into develop
samberrry Dec 28, 2022
30ce041
readme update
samberrry Dec 28, 2022
ab91580
Merge branch 'develop'
samberrry Dec 28, 2022
35c963d
readme update
samberrry Jan 29, 2023
d6b923d
chore: some text change
samberrry Jan 31, 2023
aa746c0
fix: fix fore noLocaleRoute
samberrry Jan 31, 2023
5caff6a
refactor: rename noLocaleRoute to routeWithoutLocale
samberrry Jan 31, 2023
7bd1201
Merge branch 'develop'
samberrry Jan 31, 2023
7f51af8
Add Laravel 10 support
musmanikram Apr 19, 2023
8be6f91
Merge pull request #97 from musmanikram/laravel-10-support
samberrry Apr 22, 2023
91e77da
readme update
samberrry Apr 22, 2023
bfdd413
fix: removed default_lang from binshopsblog config file
samberrry Apr 29, 2023
fcb92c5
feat: admin post search
samberrry May 16, 2023
a43ff56
Merge branch 'master' into develop
samberrry May 16, 2023
9d43d58
Merge branch 'develop'
samberrry May 16, 2023
e4d9b53
readme update
samberrry May 18, 2023
5159f8a
fix: set posted_at field as date
samberrry May 21, 2023
54a13cd
Merge branch 'develop'
samberrry May 21, 2023
d2851b1
Update index.blade.php
HarmJan1990 May 30, 2023
0fe838e
Merge pull request #103 from HarmJan1990/patch-1
samberrry May 31, 2023
e51ee69
Revert "Merge pull request #103 from HarmJan1990/patch-1"
samberrry May 31, 2023
11c417d
fix mistake: author not rendered in single post view
innhousepl Jul 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Styleci for WebDevEtc.
# Styleci for binshops.

preset: laravel

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Hessam.
Copyright (c) 2020 Binshops.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
227 changes: 139 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,122 @@
<p align="center"><a href="cms.binshops.com/" target="_blank"><img src="https://cms.binshops.com/img/hessam-cms.png"></a></p>
<h1 align="center">Laravel Blog Package</h1>

<p align="center">
<a href="https://packagist.org/packages/hessam/laravel-blogger">
<img src="https://poser.pugx.org/hessam/laravel-blogger/v/stable.png" alt="Latest Stable Version">
</a>

<a href="https://packagist.org/packages/hessam/laravel-blogger">
<img src="https://poser.pugx.org/hessam/laravel-blogger/license.png" alt="License">
</a>
<img src="https://user-images.githubusercontent.com/20775532/215362765-c2a3360e-c165-4cba-809b-4f04316c8d5e.png" width="80%" />
</p>

# Complete Laravel CMS Package
- ### Multi-level Categories
- ### Full text search
- ### Multi-language support (coming soon)
- See the progress for multi-lang in `multi-lang` branch
### Lightweight and Easy to Install

Incredible features with a lightweight laravel blog package.
- Quick installation (<3 minutes)
- It's very easy to extend
- Included great features out-of-box
- Its simplicity allows to be easily made compatible with latest laravel
- No additional concept except laravel knowledge
- Compatible with other Laravel platforms like Bagisto

## Outstanding Features
- Fulltext Search - search throughout all blog posts
- Multi Level Category - nested sets using Baum
- Multi Language Support

### Quick and easy installation (Multi-lang version)
1- Install via composer

`composer require binshops/laravel-blog`

For a fresh Laravel installation run the following too:

```
composer require laravel/ui
php artisan ui vue --auth
```

2- Scaffold

```
npm install && npm run build
```

3- Run the following two commands to copy config file, migration files, and view files

`php artisan vendor:publish --provider="BinshopsBlog\BinshopsBlogServiceProvider"`

4- Execute migrations to create tables

`php artisan migrate;`

5- 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

```
/**
* Enter your own logic (e.g. if ($this->id === 1) to
* enable this user to be able to add/edit blog posts
*
* @return bool - true = they can edit / manage blog posts,
* false = they have no access to the blog admin panel
*/
public function canManageBinshopsBlogPosts()
{
// Enter the logic needed for your app.
// Maybe you can just hardcode in a user id that you
// know is always an admin ID?

if ( $this->id === 1
&& $this->email === "your_admin_user@your_site.com"
){

// return true so this user CAN edit/post/delete
// blog posts (and post any HTML/JS)

return true;
}

// otherwise return false, so they have no access
// to the admin panel (but can still view posts)

return false;
}
```

6- Create a directory in `public/` named `blog_images`

## [Let's try it - Online Demo](https://cms.binshops.com/login)
You can try Hessam CMS online: [https://cms.binshops.com](https://cms.binshops.com/login)
7- Start the server

### Quick and easy installation
```
php artisan serve
```

Install with following command and follow the instructions.
8- Login as admin and setup your package: `/blog_admin/setup`

composer require hessam/laravel-blogger
Congrats! Your blog is ready to use. (URLs are customizable in the config file)

### For Complete Setup Instructions (with video guide), please Visit [The Install Guide](https://hessam.binshops.com/laravel-blog-package#setup)
Admin panel URI: `/blog_admin`
Front URI: `/en/blog`

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

### Single Language Version
To install the single language version of the package use version v8.1x:

1- `composer require binshops/laravel-blog:v8.2.0`

2- `php artisan vendor:publish --provider="BinshopsBlog\BinshopsBlogServiceProvider"`

3- `php artisan vendor:publish --tag=laravel-fulltext`

4- `php artisan migrate;`

You can see the single version in "single-lang" branch. The major difference with multi-language version is the database structure.

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

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

## Recent Changes
- **8.0.x** Compatibility with Laravel 8.x

## Screen Shots

<p align="center">
<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">
</p>
<p align="center">
Add post
</p>

<p align="center">
<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">
</p>
<p align="center">
All posts
</p>

<p align="center">
<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">
</p>
<p align="center">
Add category
</p>

## Recent Changes
- **9.1.x** Multi language support
- 8.0.x Compatibility with Laravel 8.x

## What/who this package is for:

- For websites running Laravel
- Who wants to have a site blog, and have an easy to use interface to write blog posts/assign categories/manage existing posts
- Anyone, 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
- 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)
- For anyone who likes to add a wordpress-like CMS to her/his web app
- For anyone who likes to add a wordpress-like laravel blog to laravel website

## How to customise the blog views/templates

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.
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.

### Customizing admin views
If you need to customize the admin view, just copy the files from
`vendor/webdevetc/blogetc/src/Views/blogetc_admin`
`vendor/binshopsblog/src/Views/binshopsblog_admin`
to
`resources/views/vendor/blogetc_admin`
`resources/views/vendor/binshopsblog_admin`
Then you can modify them just like any other view file.

## Routes

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.
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.

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

### Custom User Model
You can change the default user model through the config file.
Expand All @@ -108,9 +165,31 @@ Add these (and an Event Listener) to your `EventServiceProvider.php` file to mak

## Built in CAPTCHA / anti spam

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

There is a basic anti-spam captcha function built-in.

See the config/binshops.php captcha section. There is a built in system (basic!) that will prevent most automated spam attempts.
Writing your own captcha system:

I wrote the captcha system simple on purpose, so you can add your own captcha options. It should be easy to add any other captcha system to this.

Please see [this Captcha docs](https://hessam.binshops.com/laravel-blog-package#captcha) for more details.
If you want to write your own implementation then create your own class that implements \BinshopsBlog\Interfaces\CaptchaInterface, then update the config/binshopsblog.php file (change the captcha_type option).

There are three methods you need to implement:
public function captcha_field_name() : string

Return a string such as "captcha". It is used for the form validation and <input name=???>.
public function view() : string

What view file should the binshops::partials.add_comment_form view include? You can set this to whatever you need, and then create your own view file. The default included basic captcha class will return "binshops::captcha.basic".
public function rules() : array

Return an array for the rules (which are just the standard Laravel validation rules. This is where you can check if the captcha was successful or not.
Optional:
public function runCaptchaBeforeShowingPosts() : null

This isn't part of the interface, it isn't required. By default it does nothing. But you can put some code in this method and it'll be run in the BinshopsReaderController::viewSinglePost method.

## Image upload errors

Expand All @@ -123,41 +202,13 @@ Try adding this to config/app.php:
- 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.

## Version History
- **8.0.x** Compatibility with Laravel 8
- 7.3.2 Some bug fixes
- **9.3.x** Stable version of package
- 9.0.x Multi-language support beta release
- 8.0.x Compatibility with Laravel 8
- 7.3.0 New Admin UI
- 7.2.2
- bug fix: do not show search bar when it's disabled
- feature: configure to show full text post or preview
- 7.2.1 - adds logout button at admin panel
- 7.2.0
- adds sub-category functionality to blog
- adds reading progress bar feature (if you upgrade, re-publish config file and view files)
- 7.1.8 - ability to remove images from posts (this feature does not work for old posts)
- 7.1.7 - updates CKEditor
- 7.1.5 - minor fix for recent posts
- 7.1.4 - updates fulltext search package which solves the search issue
- 7.1.2 - shows categories on blog home page - minor fix (if you upgrade try to re-publish view files)
- 7.1.1 - minor fix and some admin panel text changes
- 7.1.0 - Adds support for custom user model (if you upgrade, try to publish new config)
- 7.0.2 - Bug fix for listing posts and search page
- 7.0.1 - made compatible with Laravel 6.x & 7.x
- 3.1 - minor fixes
- 3.0.3 - fixed RSS feed cache issue
- 3.0.2 - fixed default medium image size (changed to 600x400)
- 3.0.1 - replaced all short tags (<?) with full opening ones (<?php)
- 3.0 - Added separate functionality for uploading images (and save some meta data in db)
- 2.1 - added 'short_description' to db + form, and BlogEtcPost::generate_introduction() method will try and use this to generate intro text.
- 2.0 - added full text search (enable it via the config file - it is disabled by default).
- 1.2 - added WYSIWYG, few smaller changes
- 1.1.1 - added basic captcha
- 1.0.5 - composer.json changes.
- 1.0 - First release
- 0.3 - Small changes, packagist settings.
- 0.1 - Initial release

Contact: [email protected]




Loading