raviawasti's avatar

How can i use pagination in laravel vuejs?

Route::get('posts', 'PostController@Allposts');

public function Allposts() { return Post::with('Comment.User','User','Like','Subject') ->where('status',1)->orderBy('created_at','DESC') ->get(); }

Here is my view ( vue code in laravel blade) where i am using this localhost /posts API

@{{post.user.name}}

allpost(){

axios.get(this.bUrl +'/posts') .then(response=> { this.posts=response.data; Vue.filter('myOwnTime', function(value){ return moment(value).fromNow(); }); }) .catch(function (error) { console.log(error);//if error }); },

0 likes
1 reply

Please or to participate in this conversation.