add event UserProfileUpdated

This commit is contained in:
printempw 2016-11-18 23:06:15 +08:00
parent eb3b963dca
commit 0d006dac66
8 changed files with 30 additions and 51 deletions

View File

@ -3,7 +3,6 @@
namespace App\Events; namespace App\Events;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class CheckPlayerExists extends Event class CheckPlayerExists extends Event
{ {
@ -21,13 +20,4 @@ class CheckPlayerExists extends Event
$this->player_name = $player_name; $this->player_name = $player_name;
} }
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} }

View File

@ -3,7 +3,6 @@
namespace App\Events; namespace App\Events;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GetAvatarPreview extends Event class GetAvatarPreview extends Event
{ {
@ -24,13 +23,4 @@ class GetAvatarPreview extends Event
$this->size = $size; $this->size = $size;
} }
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} }

View File

@ -4,7 +4,6 @@ namespace App\Events;
use App\Models\Player; use App\Models\Player;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GetPlayerJson extends Event class GetPlayerJson extends Event
{ {
@ -25,13 +24,4 @@ class GetPlayerJson extends Event
$this->api_type = $api_type; $this->api_type = $api_type;
} }
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} }

View File

@ -4,7 +4,6 @@ namespace App\Events;
use App\Models\Texture; use App\Models\Texture;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GetSkinPreview extends Event class GetSkinPreview extends Event
{ {
@ -25,13 +24,4 @@ class GetSkinPreview extends Event
$this->size = $size; $this->size = $size;
} }
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} }

View File

@ -4,7 +4,6 @@ namespace App\Events;
use App\Models\Player; use App\Models\Player;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PlayerProfileUpdated extends Event class PlayerProfileUpdated extends Event
{ {
@ -22,13 +21,4 @@ class PlayerProfileUpdated extends Event
$this->player = $player; $this->player = $player;
} }
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} }

View File

@ -0,0 +1,26 @@
<?php
namespace App\Events;
use App\Models\User;
use Illuminate\Queue\SerializesModels;
class UserProfileUpdated extends Event
{
use SerializesModels;
public $type;
public $user;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($type, User $user)
{
$this->type = $type;
$this->user = $user;
}
}

View File

@ -44,7 +44,7 @@ class AdminController extends Controller
$form->group('max_upload_file_size', '最大允许上传大小', function($group) { $form->group('max_upload_file_size', '最大允许上传大小', function($group) {
// main textbox // main textbox
$group->text('max_upload_file_size'); $group->text('max_upload_file_size', option('max_upload_file_size'));
$group->addon('KB'); $group->addon('KB');
})->hint('PHP 限制:'.ini_get('post_max_size').',定义在 php.ini 中。'); })->hint('PHP 限制:'.ini_get('post_max_size').',定义在 php.ini 中。');

View File

@ -8,6 +8,7 @@ use Utils;
use App\Models\User; use App\Models\User;
use App\Models\Texture; use App\Models\Texture;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Events\UserProfileUpdated;
use App\Exceptions\PrettyPageException; use App\Exceptions\PrettyPageException;
use App\Services\Repositories\UserRepository; use App\Services\Repositories\UserRepository;
@ -124,6 +125,8 @@ class UserController extends Controller
break; break;
} }
event(new UserProfileUpdated($this->action, $this->user));
} }
/** /**