Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Nitipat Lowichakornthikun ( เต้ย )
seedcamp
Commits
65a9d889
Commit
65a9d889
authored
8 years ago
by
Nadchanon Susutlertpanya(บิว)
Browse files
Options
Download
Patches
Plain Diff
no message
parent
86a6d620
master
develop
feature/page
page
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Http/Controllers/PostController.php
+7
-3
app/Http/Controllers/PostController.php
resources/views/post/newsfeed.blade.php
+1
-1
resources/views/post/newsfeed.blade.php
resources/views/post/page_list.blade.php
+16
-26
resources/views/post/page_list.blade.php
with
24 additions
and
30 deletions
+24
-30
app/Http/Controllers/PostController.php
+
7
−
3
View file @
65a9d889
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Post
;
use
DB
;
use
App\Page
;
use
App\User
;
use
App\Http\Requests\StorePostRequest
;
...
...
@@ -25,11 +26,14 @@ class PostController extends Controller
}
])
->
orderBy
(
'updated_at'
,
'desc'
)
->
paginate
(
20
);
->
paginate
(
1
);
$pages
=
Page
::
where
(
'status'
,
true
)
->
paginate
(
10
);
$pages
=
Page
::
where
(
'status'
,
true
)
->
with
(
'followByUsers'
)
->
paginate
(
5
)
->
sortByDesc
(
function
(
$page
){
return
$page
->
followByUsers
->
count
();
});
$user_id
=
Auth
::
User
()
->
id
;
foreach
(
$posts
as
$post
)
{
if
(
$post
->
likeByUsers
)
{
...
...
This diff is collapsed.
Click to expand it.
resources/views/post/newsfeed.blade.php
+
1
−
1
View file @
65a9d889
...
...
@@ -72,7 +72,7 @@
</
div
>
@
if
(
$post
->
user
->
id
==
Auth
::
User
()
->
id
)
<
div
class
=
"dropdown pull-right"
>
<
div
class
=
"dropdown pull-right"
>
<
div
class
=
"dropdown-toggle"
id
=
"dropdownEditMenu"
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"true"
>
<
a
href
=
""
><
i
class
=
"glyphicon glyphicon-chevron-down"
></
i
></
a
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
resources/views/post/page_list.blade.php
+
16
−
26
View file @
65a9d889
<div
class=
"col-lg-2"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
Page List
</h3>
</div>
<div
class=
"panel-body"
id=
""
>
@foreach ($pages as $page)
<p
class=
"list-page"
>
<a
href=
"{{ url('/page/'.$page->id) }}"
>
<img
src=
"{{ $page->image }}"
alt=
"profile image {{ $post->name }}"
class=
"list-page-image"
>
{{$page->name }}
</a>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
Page List
</h3>
</div>
<div
class=
"panel-body"
id=
""
>
@foreach ($pages as $page)
<p
class=
"list-page"
>
<a
href=
"{{ url('/page/'.$page->id) }}"
>
<img
src=
"{{ $page->image }}"
alt=
"profile image {{ $post->name }}"
class=
"list-page-image"
>
{{$page->name }}
</a>
</p>
@endforeach
<center>
<a
href=
"#"
onclick=
"allPage()"
data-toggle=
"modal"
data-target=
"#popup_allpage"
>
More Page
</a>
</center>
</center>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets