承接 novius/laravel-nova-news 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

novius/laravel-nova-news

最新稳定版本:2.3.3

Composer 安装命令:

composer require novius/laravel-nova-news

包简介

A Laravel Nova package for news and blog posts management

README 文档

README

Laravel Nova News

Novius CI

Introduction

This Laravel Nova package allows you to manage Post news in your Laravel Nova admin panel.
You will be able to create posts, categories and tags.
You can attach multiple categories and tags to a post. Categories can be viewed as a listing page.

Requirements

  • PHP >= 8.2
  • Laravel Nova >= 4.0
  • Laravel >= 10.0

NOTE: These instructions are for Laravel >= 10.0 and PHP >= 8.2 If you are using prior version, please see the previous version's docs.

Installation

You can install the package via composer:

composer require novius/laravel-nova-news

Register the tool in the tools method of the NovaServiceProvider:

// app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \Novius\LaravelNovaNews\LaravelNovaNews(),
    ];
}

Run migrations with:

php artisan migrate

Configuration

You can optionally publish the config file with:

php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="config"

This will allow you defined routes names and

This will allow you to:

  • define the name of the routes and their parameter
  • override resource or model class
  • define locales used
// config/laravel-nova-news.php

return [
    // ...
    'resources' => [
        'post' => \App\Nova\Post::class,
    ],
];
// app/Nova/Post.php

namespace App\Nova;

use Laravel\Nova\Fields\Text;

class Post extends \Novius\LaravelNovaNews\Nova\NewsPost
{
    public function mainFields(): array
    {
        return [
            ...parent::mainFields(),

            Text::make('Subtitle'),
        ];
    }
}

Front Stuff

If you want a pre-generated front controller and routes, you can run following command :

php artisan news-manager:publish-front {--without-categories} {--without-tags} 

This command appends routes to routes/web.php and creates a new App\Http\Controllers\FrontNewsController.

You can then customize your routes and your controller.

In views called by the controller use the documentation of laravel-meta to implement meta tags

Assets

Next we need to publish the Laravel Nova Translatable package's assets. We do this by running the following command:

php artisan vendor:publish --provider="Novius\LaravelNovaTranslatable\LaravelNovaTranslatableServiceProvider" --tag="public"

Migrations and lang files

If you want to customize the migrations or lang files, you can publish them with:

php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="lang"

Testing

Run the tests with:

composer test

Lint

Lint your code with Laravel Pint using:

composer lint

Licence

This package is under GNU Affero General Public License v3 or (at your option) any later version.

统计信息

  • 总下载量: 3.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2024-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固