{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15315","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15315/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15315/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15315/events","html_url":"https://github.com/laravel/framework/issues/15315","id":175428865,"number":15315,"title":"How to paginate Laravel 5.3 database Notifications","user":{"login":"ahmadbadpey","id":747216,"avatar_url":"https://avatars.githubusercontent.com/u/747216?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmadbadpey","html_url":"https://github.com/ahmadbadpey","followers_url":"https://api.github.com/users/ahmadbadpey/followers","following_url":"https://api.github.com/users/ahmadbadpey/following{/other_user}","gists_url":"https://api.github.com/users/ahmadbadpey/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadbadpey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadbadpey/subscriptions","organizations_url":"https://api.github.com/users/ahmadbadpey/orgs","repos_url":"https://api.github.com/users/ahmadbadpey/repos","events_url":"https://api.github.com/users/ahmadbadpey/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadbadpey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-07T07:10:01Z","updated_at":"2016-09-07T07:12:47Z","closed_at":"2016-09-07T07:12:47Z","body":"We know that Notifications in Laravel 5.3 can sent via many channels and can store in database.\r\n\r\nAnd we know that can fetch all notifications of a User and show them like this :\r\n```\r\n $user = App\\User::find(1);\r\n\r\nforeach ($user->notifications as $notification) {\r\n    echo $notification->type;\r\n}\r\n```\r\nBut Suppose case that I have a AllNotifications page that show all notifications of a user and I want to paginate that.\r\n\r\nIs there any way to paginate notifications ?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/245195019","html_url":"https://github.com/laravel/framework/issues/15315#issuecomment-245195019","issue_url":"https://api.github.com/repos/laravel/framework/issues/15315","id":245195019,"user":{"login":"themsaid","id":4332182,"avatar_url":"https://avatars.githubusercontent.com/u/4332182?v=3","gravatar_id":"","url":"https://api.github.com/users/themsaid","html_url":"https://github.com/themsaid","followers_url":"https://api.github.com/users/themsaid/followers","following_url":"https://api.github.com/users/themsaid/following{/other_user}","gists_url":"https://api.github.com/users/themsaid/gists{/gist_id}","starred_url":"https://api.github.com/users/themsaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themsaid/subscriptions","organizations_url":"https://api.github.com/users/themsaid/orgs","repos_url":"https://api.github.com/users/themsaid/repos","events_url":"https://api.github.com/users/themsaid/events{/privacy}","received_events_url":"https://api.github.com/users/themsaid/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T07:12:47Z","updated_at":"2016-09-07T07:12:47Z","body":"You can use `$user->notifications()->paginate()`, the `HasDatabaseNotifications` trait has a regular morphMany relationship."}}
{"actor":{"display_login":"themsaid"}}