Skip to content

fix posted_at #40

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 82 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 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
544361b
fix posted_at
lucass3na Apr 24, 2021
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
161 changes: 104 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,110 @@
<p align="center"><a href="cms.binshops.com/" target="_blank"><img src="https://cms.binshops.com/img/hessam-cms.png"></a></p>
# Laravel Blog
Have you worked with Wordpress? Developers call this package wordpress-like laravel blog.

<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>
### Contact us for any customization:
[email protected]

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

# 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
Incredible features with a lightweight laravel blog package. I highly recommend it because:
- 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

## [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)
## Outstanding Features
- Fulltext Search - search throughout all blog posts
- Multi Level Category - nested sets using Baum
- Multi Language Support

### Quick and easy installation
1- Install via composer

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

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

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

To see package on Packagist click this [Link](https://packagist.org/packages/hessam/laravel-blogger)
2- Run the following two commands to copy config file, migration files, and view files

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

3- Execute migrations to create tables

`php artisan migrate;`

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

```
/**
* 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;
}
```

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

6- Login as admin and setup your package: `/blog_admin/setup`

Congrats! Your blog is ready to use. (URLs are customizable in the config file)

Admin panel URI: `/blog_admin`
Front URI: `/en/blog`

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

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.

## 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 @@ -47,55 +114,33 @@ To see package on Packagist click this [Link](https://packagist.org/packages/hes
- 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>
- **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
- 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 @@ -110,7 +155,7 @@ Add these (and an Event Listener) to your `EventServiceProvider.php` file to mak

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

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

## Image upload errors

Expand All @@ -123,7 +168,9 @@ 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
- **9.2.x** Stable version of package
- 9.0.x Multi-language support beta release
- 8.0.x Compatibility with Laravel 8
- 7.3.2 Some bug fixes
- 7.3.0 New Admin UI
- 7.2.2
Expand All @@ -147,7 +194,7 @@ Try adding this to config/app.php:
- 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.1 - added 'short_description' to db + form, and BinshopsBlogPost::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
Expand All @@ -156,7 +203,7 @@ Try adding this to config/app.php:
- 0.3 - Small changes, packagist settings.
- 0.1 - Initial release

Contact: hessam.modaberi@gmail.com
Contact: contact@binshops.com



Expand Down
23 changes: 12 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hessam/laravel-blogger",
"name": "binshops/laravel-blog",
"keywords": [
"laravel",
"blog",
Expand All @@ -12,26 +12,26 @@
"posts",
"news",
"update",
"hessam-blog"
"laravel blog",
"binshops"
],
"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.",
"license": "MIT",
"support": {
"docs": "https://hessam.binshops.com/laravel-blog-package/"
"docs": "https://github.com/binshops/laravel-blog"
},
"authors": [
{
"name": "Hessam",
"homepage": "http://hessam.binshops.com",
"role": "developer",
"email": "hessam.modaberi@gmail.com"
"name": "Binshops",
"homepage": "https://github.com/binshops/laravel-blog",
"role": "owner",
"email": "contact@binshops.com"
}
],
"require": {
"cviebrock/eloquent-sluggable": "~8.0|~7.0|~6.0|~4.8|~4.7|~4.6|~4.5",
"laravelium/feed": "~2.12.0|~3.0.0|3.1.*|v6.0.*|v7.0.*|v8.0.*",
"intervention/image": "2.*",
"swisnl/laravel-fulltext": "^0.20.0",
"laravel/helpers": "^1.3"
},
"require-dev": {
Expand All @@ -41,18 +41,19 @@
},
"autoload": {
"psr-4": {
"WebDevEtc\\BlogEtc\\": "src"
"BinshopsBlog\\": "src",
"BinshopsBlog\\Laravel\\Fulltext\\": "src/FulltextSearch/src/"
}
},
"autoload-dev": {
"psr-4": {
"WebDevEtc\\BlogEtc\\Tests\\": "tests"
"BinshopsBlog\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"WebDevEtc\\BlogEtc\\BlogEtcServiceProvider"
"BinshopsBlog\\BinshopsBlogServiceProvider"
],
"aliases": {
}
Expand Down
40 changes: 40 additions & 0 deletions migrations/2016_11_04_152913_create_laravel_fulltext_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLaravelFulltextTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection(config('laravel-fulltext.db_connection'))->create('laravel_fulltext', function (Blueprint $table) {
$table->increments('id');
$table->integer('indexable_id');
$table->string('indexable_type');
$table->text('indexed_title');
$table->text('indexed_content');

$table->unique(['indexable_type', 'indexable_id']);

$table->timestamps();
});

DB::connection(config('laravel-fulltext.db_connection'))->statement('ALTER TABLE laravel_fulltext ADD FULLTEXT fulltext_title(indexed_title)');
DB::connection(config('laravel-fulltext.db_connection'))->statement('ALTER TABLE laravel_fulltext ADD FULLTEXT fulltext_title_content(indexed_title, indexed_content)');
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection(config('laravel-fulltext.db_connection'))->drop('laravel_fulltext');
}
}
Loading