Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
e77b160c
Commit
e77b160c
authored
Jan 30, 2023
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RSS
parent
22067fca
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
app/Http/Controllers/RssFeedNewController.php
+4
-6
resources/views/rss/feednew.blade.php
+28
-0
routes/web.php
+1
-0
No files found.
app/Http/Controllers/RssFeedNewController.php
View file @
e77b160c
...
@@ -7,11 +7,9 @@ class RssFeedNewController extends Controller
...
@@ -7,11 +7,9 @@ class RssFeedNewController extends Controller
public
function
feed
()
public
function
feed
()
{
{
$setting
=
webprofilesetting
();
$setting
=
webprofilesetting
();
// $posts = Posts::where('post_status', 't')->
$posts
=
Posts
::
where
(
'post_status'
,
't'
)
->
// orderBy('post_date', 'desc')->
orderBy
(
'post_date'
,
'desc'
)
->
// limit(10)->get();
limit
(
30
)
->
get
();
$posts
=
Posts
::
orderBy
(
'created_at'
)
->
get
();
return
$data
=
response
()
->
view
(
'rss.feednew'
,
compact
(
'posts'
,
'setting'
))
->
header
(
'Content-Type'
,
'application/xml'
);
$data
=
response
()
->
view
(
'rss.feed'
,
compact
(
'posts'
,
'setting'
))
->
header
(
'Content-Type'
,
'application/xml'
);
return
strip_tags
(
$data
);
}
}
}
}
resources/views/rss/feednew.blade.php
0 → 100644
View file @
e77b160c
<?=
'<?xml version="1.0" encoding="UTF-8"?>'
.
PHP_EOL
?>
<rss
version=
"2.0"
>
<channel>
<title>
RSS {{$setting['web_title']}}
</title>
<link>
{{ url('') }}>
</link>
<description>
RSS {{$setting['web_title']}}>
</description>
<language>
{{ $setting['default_language'] }}
</language>
<copyright>
{{$setting['web_title']}}
</copyright>
<lastBuildDate>
{{ now() }}
</lastBuildDate>
<generator>
feed_domain ({{ $setting['email'] }})
</generator>
@foreach($posts as $post)
<item>
<id>
{{ $post->id }}
</id>
<title>
{{ $post->title }}
</title>
<description>
{{ strip_tags(($post->content)) }}
</description>
<link>
{{ url('post/'.$post['slug'])}}
</link>
<pubDate>
{{ $post->post_date }}
</pubDate>
<image>
{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $post->thumbnail }}
</image>
<guid
isPermaLink=
"false"
>
{{ url('post/'.$post['slug']) }}
</guid>
<kategori>
{{ $post->rCategory->name }}
</kategori>
<views>
{{ $post->viewer }}
</views>
</item>
@endforeach
</channel>
</rss>
routes/web.php
View file @
e77b160c
...
@@ -23,3 +23,4 @@ Route::post('/change-language', 'TranslateController@changeLocale')->name('langu
...
@@ -23,3 +23,4 @@ Route::post('/change-language', 'TranslateController@changeLocale')->name('langu
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'rss'
,
'RssFeedController@feed'
);
Route
::
get
(
'rss'
,
'RssFeedController@feed'
);
Route
::
get
(
'rssnew'
,
'RssFeedNewController@feed'
);
Route
::
get
(
'rssnew'
,
'RssFeedNewController@feed'
);
// Route::get('cekrss', 'CekRssFeedController@cekRss');
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment