ozankurt/laravel-blog
最新稳定版本:0.1.0
Composer 安装命令:
composer require ozankurt/laravel-blog
包简介
Ready to use blog module for laravel.
README 文档
README
Laravel Blog is a package that provides a simple blog system for Laravel applications.
Features
- Categories
- Posts
- Comments
- Media Types (Text, Single Image, Multiple Image, Video)
- Video Embedding (YouTube, Vimeo, DailyMotion)
External Requirements
This package requires 2 external packages for its functionality.
External Suggestions
You can use the following packages to enhance the functionality of the blog system.
Installation
You can install the package via composer:
composer require ozankurt/laravel-blog
Publish the package assets:
php artisan vendor:publish --provider="Ozankurt\Blog\BlogServiceProvider"
Run the migrations:
php artisan migrate
Usage
Modify the config/blog.php configuration file to customize the package settings.
return [ 'database' => [ 'connection' = env('DB_CONNECTION', 'mysql'), 'table_prefix' => 'blog_', ], 'models' => [ 'user' => App\Models\User::class, /** If you want to use your own models, you can extend the package models. */ 'category' => OzanKurt\Blog\Category::class, 'comment' => OzanKurt\Blog\Comment::class, 'post' => OzanKurt\Blog\Post::class, ], 'media' => [ 'disk' => 'public', ], 'video_thumbnail_qualities' => [ /** Vimeo options: 'thumbnail_small', 'thumbnail_medium', 'thumbnail_large' */ 'vimeo' => 'thumbnail_medium', /** YouTube options: '0', '1', '2', '3', 'default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault' */ 'youtube' => 'default', ], 'caching' => [ 'enabled' => false, 'duration' => 15, ], ];
API
Category
| Methods | Relationship |
|---|---|
| posts() | HasMany |
| latestPost() | HasOne |
Post
Posts have a type_id attribute so that the users can choose between:
- Text Post
- Single Image Post
- Multiple Image Post
- Video Post
Videos support 3 different providers:
- YouTube
- Vimeo
- DailyMotion
| Methods | Relationship |
|---|---|
| category() | BelongsTo |
| user() | BelongsTo |
| comments() | HasMany |
| latestComment() | HasOne |
Comment
| Methods | Relationship |
|---|---|
| post() | BelongsTo |
| user() | BelongsTo |
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-25