Skip to content

Commit

Permalink
Update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
cretueusebiu committed Aug 11, 2016
1 parent 3e397a2 commit b1ef783
Show file tree
Hide file tree
Showing 47 changed files with 4,742 additions and 1,050 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Expand Up @@ -10,3 +10,7 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{vue,js,json,html,scss}]
indent_style = space
indent_size = 2
32 changes: 17 additions & 15 deletions .env.example
@@ -1,26 +1,26 @@
APP_ENV=local
APP_KEY=SomeRandomString
APP_ENV="local"
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_LOG_LEVEL="debug"
APP_URL="http://localhost"

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_CONNECTION="mysql"
DB_HOST="127.0.0.1"
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_DATABASE="homestead"
DB_USERNAME="homestead"
DB_PASSWORD="secret"

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
CACHE_DRIVER="file"
SESSION_DRIVER="file"
QUEUE_DRIVER="sync"

REDIS_HOST=127.0.0.1
REDIS_HOST="127.0.0.1"
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_DRIVER="smtp"
MAIL_HOST="mailtrap.io"
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
Expand All @@ -29,6 +29,8 @@ MAIL_ENCRYPTION=null
GCM_KEY=
GCM_SENDER_ID=

BROADCAST_DRIVER="pusher"

PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
28 changes: 24 additions & 4 deletions .eslintrc
Expand Up @@ -4,7 +4,7 @@
"rules": {
"indent": [
2,
4
2
],
"quotes": [
1,
Expand All @@ -24,14 +24,34 @@
"browser": true
},
"ecmaFeatures": {
"modules": true
"arrowFunctions": true,
"destructuring": true,
"classes": true,
"defaultParams": true,
"blockBindings": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"restParams": true,
"spread": true,
"forOf": true,
"generators": true,
"templateStrings": true,
"superInFunctions": true,
"experimentalObjectRestSpread": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"sourceType": "module"
"sourceType": "module",
"spread": true,
"experimentalObjectRestSpread": true
}
},
"extends": "eslint:recommended"
"extends": "eslint:recommended",
"plugins": [
"html"
]
}
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,3 @@
Homestead.yaml
Homestead.json
.env
composer.lock
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# Laravel Web Push Notifications Demo

> A demo showcasing the new [Notifications](https://github.com/laravel/framework/tree/5.3/src/Illuminate/Notifications) and [Echo](https://github.com/laravel/echo) features from [Laravel 5.3](https://mattstauffer.co/blog/series/new-features-in-laravel-5-3).
> A demo showcasing the new [Notifications](https://laravel.com/docs/master/notifications) and [Echo](https://github.com/laravel/echo) features from [Laravel 5.3].
![Demo](http://i.imgur.com/3QmEeVl.gif)

Expand All @@ -9,8 +9,8 @@
- `git clone https://github.com/cretueusebiu/laravel-web-push-demo.git`
- `cd laravel-web-push-demo`
- `composer install`
- `cp .env.example .env`
- `php artisan key:generate`
- `cp .env.example .env`
- Edit `.env`
- Set your database connection details
- Set `GCM_KEY` and `GCM_SENDER_ID` from [Google Console](https://console.cloud.google.com)
Expand Down
41 changes: 0 additions & 41 deletions app/Events/NotificationCreated.php

This file was deleted.

3 changes: 2 additions & 1 deletion app/Events/NotificationRead.php
Expand Up @@ -3,6 +3,7 @@
namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

Expand Down Expand Up @@ -42,6 +43,6 @@ public function __construct($userId, $notificationId)
*/
public function broadcastOn()
{
return ['private-user.'.$this->userId.'.notifications'];
return [new PrivateChannel("App.User.{$this->userId}")];
}
}
3 changes: 2 additions & 1 deletion app/Events/NotificationReadAll.php
Expand Up @@ -3,6 +3,7 @@
namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

Expand Down Expand Up @@ -35,6 +36,6 @@ public function __construct($userId)
*/
public function broadcastOn()
{
return ['private-user.'.$this->userId.'.notifications'];
return [new PrivateChannel("App.User.{$this->userId}")];
}
}
20 changes: 10 additions & 10 deletions app/Exceptions/Handler.php
Expand Up @@ -26,39 +26,39 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $exception
* @return void
*/
public function report(Exception $e)
public function report(Exception $exception)
{
parent::report($e);
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Exception $exception)
{
return parent::render($request, $e);
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $e
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $e)
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
} else {
return redirect()->guest('login');
}

return redirect()->guest('login');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Expand Up @@ -14,7 +14,7 @@ class LoginController extends Controller
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide this functionality to your appliations.
| to conveniently provide its functionality to your applications.
|
*/

Expand Down

0 comments on commit b1ef783

Please sign in to comment.