@@ -44,7 +44,11 @@ class DashboardController extends Controller
|
||||
$image_counts = Post::where('user_id', Auth::user()->getAuthIdentifier())
|
||||
->where('image', '!=', 'null')
|
||||
->count();
|
||||
$posts = Post::where('user_id', $user_id)->orderBy('date_post', 'DESC')->paginate(9);
|
||||
$posts = Post::where('user_id', $user_id)
|
||||
->when(request('search', false), static function ($post, $search) {
|
||||
return $post->where('content', 'like', '%'.$search.'%');
|
||||
})
|
||||
->orderBy('date_post', 'DESC')->paginate(9);
|
||||
$today_post = Post::whereDate('date_post', '=', $today->format('Y-m-d'))
|
||||
->where('user_id', $user_id)
|
||||
->count();
|
||||
|
@@ -42,4 +42,12 @@ class User extends Authenticatable
|
||||
$arrayHash = str_split(strtolower(md5($this->id)));
|
||||
return sprintf('%s/%s', $arrayHash[0], $arrayHash[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isE2E()
|
||||
{
|
||||
return (bool) $this->encrypt_messages;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user