【发布时间】: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 类似。
【问题讨论】:
-
“它不工作。” ...不是很引人注目
-
你能看到任何错误吗?
-
不,它不工作
-
我没有发现错误。而不是主题显示标签。
-
“不工作”是什么意思???资源是否已复制到您的资源/供应商文件夹中?