Level 35
Just the two first google results for: laravel vue pagination:
- https://github.com/gilbitron/laravel-vue-pagination
- https://www.cloudways.com/blog/vue-pagination-in-laravel/
In other words, what did you try, where did you get stuck?
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 }); },
Please or to participate in this conversation.