976-tuna/news
最新稳定版本:v1.2.16
Composer 安装命令:
composer require 976-tuna/news
包简介
NEWS
README 文档
README
Installation
install Laravel
Install Bootstrap
composer require laravel/ui --dev php artisan ui bootstrap --auth
Install the bootstrap icons library.
npm install bootstrap-icons --save-dev
Install the Livewire and assets.
composer require livewire/livewire php artisan livewire:publish --assets
Install Package
composer require 976-tuna/news php artisan vendor:publish --provider="Tuna976\NEWS\NEWSServiceProvider" --tag="news-files" php artisan migrate
Integration
Add the following to your user model:
// Role-based authentication methods
public function isAdmin(): bool
{
return $this->role === 'admin';
}
public function isAuthor(): bool
{
return $this->role === 'author' || $this->isAdmin();
}
public function posts(): HasMany
{
return $this->hasMany(Post::class);
}
public function comments(): HasMany
{
return $this->hasMany(Comment::class);
}
Inside your project, open the file resources\sass\app.scss and add :
@import 'bootstrap-icons/font/bootstrap-icons.css';
Inside your project, open the file app/Http/Controllers/Controller.php and make sure you have the following so Auth works properly
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
abstract class Controller
{
use AuthorizesRequests;
}
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-21