【问题标题】:php artisan vendor publish not workingphp工匠供应商发布不起作用
【发布时间】:2017-12-11 20:59:10
【问题描述】:

我使用 laravel 5.5 并安装

composer require roumen/feed

我尝试在我的资源文件夹中加载文件供应商以更改分页代码。当我尝试这样的 php 工匠时

php artisan vendor:publish

它不工作。

FeedController

<?php

namespace App\Http\Controllers;

use App\Article;
use Illuminate\Http\Request;

class FeedController extends Controller
{
    public function articles()
    {
        $feed = app()->make('feed');

        $feed->setCache(1,'laravel.feed.article');

        if(! $feed->isCached() ) {
            $articles = Article::latest()->take(10)->get();

            foreach ($articles as $article) {
                $feed->add($article->title,$article->user->name, url($article->path()),$article->created_at , strip_tags($article->description) , strip_tags($article->body));
            }
        }

        return $feed->render('rss');
    }
}

我的刀

<link rel="alternate" type="application/rss+xml" title="فید مقالات راکت" href="/feed/articles">

但我在图片下运行http://localhost:8000/feed/articles 类似。

Simple

【问题讨论】:

  • “它不工作。” ...不是很引人注目
  • 你能看到任何错误吗?
  • 不,它不工作
  • 我没有发现错误。而不是主题显示标签。
  • “不工作”是什么意思???资源是否已复制到您的资源/供应商文件夹中?

标签: php laravel


【解决方案1】:

从Packagist复制

向 Laravel 注册该服务提供者:

Roumen\Feed\FeedServiceProvider::class,

并添加类别名:

'Feed' => Roumen\Feed\Feed::class,

发布包视图(可选):

php artisan vendor:publish --provider="Roumen\Feed\FeedServiceProvider"

【讨论】:

    猜你喜欢
    • 2016-12-10
    • 2016-05-12
    • 2016-03-19
    • 1970-01-01
    • 2017-11-12
    • 2019-07-17
    • 2019-01-25
    • 2018-09-26
    • 1970-01-01
    相关资源
    最近更新 更多