raviawasti
2 months ago

How can i use pagination in laravel vuejs?

Posted 2 months ago by raviawasti

Route::get('posts', '[email protected]');

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 }); },

Please sign in or create an account to participate in this conversation.