├── public ├── favicon.ico ├── robots.txt ├── mix-manifest.json ├── fonts │ └── vendor │ │ └── bootstrap-sass │ │ └── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 ├── .htaccess └── index.php ├── database ├── seeds │ ├── .gitkeep │ ├── PostsTableSeeder.php │ ├── UsersTableSeeder.php │ └── DatabaseSeeder.php ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2017_04_25_211918_create_followers_table.php │ ├── 2017_03_10_172317_create_posts_table.php │ ├── 2014_10_12_000000_create_users_table.php │ └── 2017_04_25_214632_create_notifications_table.php └── factories │ └── ModelFactory.php ├── resources ├── assets │ ├── js │ │ ├── bootstrap.js │ │ ├── components │ │ │ └── Example.vue │ │ └── app.js │ └── sass │ │ ├── app.scss │ │ └── variables.scss ├── views │ ├── vendor │ │ └── .gitkeep │ ├── layouts │ │ ├── partials │ │ │ └── _notifications.blade.php │ │ └── app.blade.php │ ├── posts │ │ ├── index.blade.php │ │ ├── show.blade.php │ │ ├── create.blade.php │ │ └── edit.blade.php │ ├── home.blade.php │ ├── errors │ │ └── 503.blade.php │ ├── auth │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ ├── users │ │ └── index.blade.php │ └── welcome.blade.php └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ ├── passwords.php │ └── validation.php ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── .gitattributes ├── .gitignore ├── app ├── Post.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── RedirectIfAuthenticated.php │ │ └── MarkNotificationAsRead.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── Auth │ │ │ ├── ResetPasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ └── RegisterController.php │ │ ├── UsersController.php │ │ └── PostsController.php │ └── Kernel.php ├── Observers │ └── PostObserver.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Console │ └── Kernel.php ├── User.php ├── Notifications │ ├── UserFollowed.php │ └── NewPost.php └── Exceptions │ └── Handler.php ├── tests ├── ExampleTest.php └── TestCase.php ├── routes ├── console.php ├── api.php ├── channels.php └── web.php ├── webpack.mix.js ├── .env.example ├── server.php ├── phpunit.xml ├── config ├── compile.php ├── services.php ├── view.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── cache.php ├── auth.php ├── database.php ├── mail.php ├── session.php └── app.php ├── package.json ├── composer.json ├── artisan └── readme.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/storage 3 | /vendor 4 | /.idea 5 | Homestead.json 6 | Homestead.yaml 7 | .env 8 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sitepoint-editors/laravel-pusher-notifications/HEAD/public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sitepoint-editors/laravel-pusher-notifications/HEAD/public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sitepoint-editors/laravel-pusher-notifications/HEAD/public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sitepoint-editors/laravel-pusher-notifications/HEAD/public/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /resources/views/layouts/partials/_notifications.blade.php: -------------------------------------------------------------------------------- 1 | @if (session('success')) 2 |
{{ $post->description }}
10 | @endforeach 11 | {{ $posts->links() }} 12 | 13 | @endsection 14 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | $this->call(PostsTableSeeder::class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | {{ $post->title }} 7 |{{ $post->description }}
8 | 9 | 15 | 16 | @endsection 17 | -------------------------------------------------------------------------------- /app/Observers/PostObserver.php: -------------------------------------------------------------------------------- 1 | user; 17 | foreach ($user->followers as $follower) { 18 | $follower->notify(new NewPost($user, $post)); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | 5 || User | 17 |18 | 19 | 20 | @foreach ($users as $user) 21 | | |
|---|---|---|
{{ $user->name }} |
23 | @if (auth()->user()->isFollowing($user->id))
24 | 25 | 33 | | 34 | @else 35 |36 | 43 | | 44 | @endif 45 |