Skip to content

Commit 8bd33bf

Browse files
committed
IMP: Add Setting feature.
0 parents  commit 8bd33bf

File tree

148 files changed

+16951
-0
lines changed

Some content is hidden

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

148 files changed

+16951
-0
lines changed

.DS_Store

8 KB
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
.github

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":{"Firefly\\FilamentBlog\\Tests\\Integration\\DemoTest::test_demo":8,"Firefly\\FilamentBlog\\Tests\\Integration\\DemoTest::test_route":7,"Firefly\\FilamentBlog\\Tests\\Feature\\DemoTest::test_route":8},"times":{"Firefly\\FilamentBlog\\Tests\\Integration\\DemoTest::test_demo":0.026,"Firefly\\FilamentBlog\\Tests\\Integration\\DemoTest::test_route":0.087,"Firefly\\FilamentBlog\\Tests\\Feature\\DemoTest::test_route":0.055}}

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
Contributions are welcome and will be fully credited.
4+
5+
Contributions are accepted via Pull Requests on [Github](https://github.com/thefireflytech/filament-blog).
6+
7+
# Things you could do
8+
If you want to contribute but do not know where to start, this list provides some starting points.
9+
- Add license text
10+
- Remove rewriteRules.php
11+
- Set up TravisCI, StyleCI, ScrutinizerCI
12+
- Write a comprehensive ReadMe
13+
14+
## Pull Requests
15+
16+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
17+
18+
- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.
19+
20+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
21+
22+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
23+
24+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
25+
26+
27+
**Happy coding**!

LICENSE.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Firefly
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), for personal use only.
7+
Personal use includes the use, copy, modification, merge, publication, and
8+
distribution of the Software. Any form of commercial use, including but not limited
9+
to selling the package or modifying it for selling purposes, is strictly prohibited.
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# Firefly Filament Blog
2+
The Filament Blog Plugin is a feature-rich plugin designed to enhance your blogging experience on your website. It comes with a variety of powerful features to help you manage and customize your blog posts effectively.
3+
4+
[![Latest Version on Packagist][ico-version]][link-packagist]
5+
[![Total Downloads][ico-downloads]][link-downloads]
6+
![Packagist License][ico-license]
7+
![GitHub forks][ico-forks]
8+
![GitHub Org's stars][ico-stars]
9+
10+
11+
12+
![Firefly Filament Blog](images/landing.png)
13+
14+
## Features
15+
16+
- **Easy Installation:** Simple and straightforward installation process.
17+
- **User-Friendly Interface:** Intuitive and user-friendly interface for easy management of blog posts.
18+
- **SEO Meta Extension:** Enhance your blog's search engine optimization with built-in meta tag customization.
19+
- **Post Scheduled for Future:** Schedule your blog posts to be published at a future date and time.
20+
- **Social Media Share Feature:** Allow users to easily share your blog posts on social media platforms.
21+
- **Comment Feature:** Enable comments on your blog posts to encourage engagement and discussion.
22+
- **Newsletter Subscription:** Integrate newsletter subscription forms to grow your email list.
23+
- **New Post Published Notification:** Notify subscribers when a new blog post is published.
24+
- **Category Search:** Categorize your blog posts for easy navigation and search.
25+
- **Support**: [Laravel 11](https://laravel.com) and [Filament 3.x](https://filamentphp.com)
26+
27+
### Demo Video
28+
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/8UkcAicQZUc/0.jpg)](https://www.youtube.com/watch?v=8UkcAicQZUc)
29+
30+
## Installation
31+
If your project is not already using Filament, you can install it by running the following commands:
32+
```bash
33+
composer require filament/filament:"^3.2" -W
34+
```
35+
```bash
36+
php artisan filament:install --panels
37+
```
38+
Install the Filament Blog Plugin by running the following command:
39+
```bash
40+
composer require firefly/filament-blog
41+
```
42+
43+
## Usage
44+
After composer require, you can start using the Filament Blog Plugin by runing the following command:
45+
46+
```bash
47+
php artisan filament-blog:install
48+
```
49+
This command will publish `filamentblog.php` config file and `create_blog_tables.php` migration file.
50+
````php
51+
<?php
52+
/**
53+
* |--------------------------------------------------------------------------
54+
* | Set up your blog configuration
55+
* |--------------------------------------------------------------------------
56+
* |
57+
* | This file is for storing the configuration of your blog.
58+
* | The route configuration is for setting up the route prefix and middleware.
59+
* | The user configuration is for setting up the user model and columns.
60+
* | The seo configuration is for setting up the default meta tags for the blog.
61+
* | The recaptcha configuration is for setting up the recaptcha for the blog.
62+
* |
63+
* /
64+
*/
65+
66+
return [
67+
'route' => [
68+
'prefix' => 'blogs',
69+
'middleware' => ['web'],
70+
'login' => [
71+
'name' => 'filament.admin.auth.login',
72+
],
73+
],
74+
'user' => [
75+
'model' => App\Models\User::class,
76+
'foreign_key' => 'user_id',
77+
'columns' => [
78+
'name' => 'name',
79+
'avatar' => 'profile_photo_path', // column name of avatar
80+
],
81+
],
82+
'seo' => [
83+
'meta' => [
84+
'title' => 'Filament Blog',
85+
'description' => 'This is filament blog seo meta description',
86+
'keywords' => [],
87+
],
88+
],
89+
90+
'recaptcha' => [
91+
'enabled' => false, // true or false
92+
'site_key' => env('RECAPTCHA_SITE_KEY'),
93+
'secret_key' => env('RECAPTCHA_SECRET_KEY'),
94+
],
95+
];
96+
````
97+
Before running the migration, you can modify the `filamentblog.php` config file to suit your needs.
98+
99+
If you want to publish config, views, components, and migrations individually you can run the following command:
100+
```bash
101+
php artisan vendor:publish --provider="Firefly\FilamentBlog\FilamentBlogServiceProvider" --tag=filament-blog-views
102+
```
103+
```bash
104+
php artisan vendor:publish --provider="Firefly\FilamentBlog\FilamentBlogServiceProvider" --tag=filament-blog-config
105+
```
106+
```bash
107+
php artisan vendor:publish --provider="Firefly\FilamentBlog\FilamentBlogServiceProvider" --tag=filament-blog-components
108+
```
109+
```bash
110+
php artisan vendor:publish --provider="Firefly\FilamentBlog\FilamentBlogServiceProvider" --tag=filament-blog-migrations
111+
```
112+
113+
## What if you have already a User model?
114+
- If you already have a User model, you can modify the `filamentblog.php` config file to use your User model.
115+
- Make sure the name column is the user's `name` column.
116+
- If you have already `avatar` column in your User model, you can set it in the `filamentblog.php` config file in `user.columns.avatar` key.
117+
- If you want to change `foreign_key` column name, you can modify the `filamentblog.php` config file.
118+
119+
### Migrate the database
120+
After modifying the `filamentblog.php` config file, you can run the migration by running the following command:
121+
```bash
122+
php artisan migrate
123+
```
124+
### Storage Link
125+
After running the migration, you can create a symbolic link to the storage directory by running the following command:
126+
```bash
127+
php artisan storage:link
128+
```
129+
### Attach filament blog panel to the dashboard
130+
You can attach the Filament Blog panel to the dashboard by adding the following code to your panel provider:
131+
Add `Blog::make()` to your panel passing the class to your `plugins()` method.
132+
133+
```php
134+
use Firefly\FilamentBlog\Blog;
135+
136+
public function panel(Panel $panel): Panel
137+
{
138+
return $panel
139+
->plugins([
140+
Blog::make()
141+
])
142+
}
143+
```
144+
145+
### Manage user relationship
146+
If you want to manage the user relationship, you can modify the `User` model to have a relationship with the `Post` model.
147+
```php
148+
<?php
149+
150+
namespace App\Models;
151+
152+
// use Illuminate\Contracts\Auth\MustVerifyEmail;
153+
use Firefly\FilamentBlog\Traits\HasBlog;
154+
use Illuminate\Foundation\Auth\User as Authenticatable;
155+
156+
class User extends Authenticatable
157+
{
158+
use HasBlog;
159+
}
160+
```
161+
### Allow user to comment
162+
If you want to allow users to comment on blog posts, you can modify the `User` model to add a method `canComment()`.
163+
164+
```php
165+
<?php
166+
167+
namespace App\Models;
168+
169+
// use Illuminate\Contracts\Auth\MustVerifyEmail;
170+
use Firefly\FilamentBlog\Traits\HasBlog;
171+
use Illuminate\Foundation\Auth\User as Authenticatable;
172+
173+
class User extends Authenticatable
174+
{
175+
public function canComment(): bool
176+
{
177+
// your conditional logic here
178+
return true;
179+
}
180+
181+
}
182+
```
183+
Now you can start using the Filament Blog Plugin to manage your blog posts effectively.
184+
```yourdomain.com/blogs```
185+
You can change the route prefix in the `filamentblog.php` config file.
186+
187+
### Social Media Share
188+
For social media share, please visit [Sharethis](https://platform.sharethis.com) and generate the JS Script and HTML code and save from our share snippet section.
189+
190+
### Recaptcha
191+
To add the recaptcha to the blog comment form, you can add environment variables in your `.env` file.
192+
And make sure enabled is set to `true` in the `filamentblog.php` config file.
193+
```
194+
RECAPTCHA_SITE_KEY
195+
RECAPTCHA_SECRET_KEY
196+
```
197+
## Credits
198+
199+
- [Author Name][link-author]
200+
- [All Contributors][link-contributors]
201+
202+
### Security
203+
204+
If you discover a security vulnerability within this package, please send an e-mail to [email protected], All security vulnerabilities will be promptly addressed.
205+
206+
### 🤝 Contributing
207+
208+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
209+
210+
### 📄 License
211+
212+
The MIT License (MIT). Please see [License File](LICENSE.txt) for more information.
213+
214+
215+
<i>Made with love by Firefly IT Solutions, Nepal - [thefireflytech.com](https://thefireflytech.com)</i>
216+
217+
218+
[ico-version]: https://img.shields.io/packagist/v/firefly/filament-blog.svg?style=flat-square
219+
[ico-downloads]: https://img.shields.io/packagist/dt/firefly/filament-blog.svg?style=flat-square
220+
[ico-stable]: https://img.shields.io/packagist/s/firefly/filament-blog.svg?style=flat-square
221+
[ico-license]: https://img.shields.io/packagist/l/firefly/filament-blog.svg?style=flat-square
222+
[ico-forks]: https://img.shields.io/github/forks/thefireflytech/filament-blog.svg?style=flat-square
223+
[ico-stars]: https://img.shields.io/github/stars/thefireflytech?style=flat-square
224+
225+
226+
[link-packagist]: https://packagist.org/packages/firefly/filament-blog
227+
[link-downloads]: https://packagist.org/packages/firefly/filament-blog
228+
[link-author]: https://github.com/thefireflytech
229+
[link-contributors]: ../../contributors

0 commit comments

Comments
 (0)