From 0d006dac661987b496ac669253ca294ebbce4d56 Mon Sep 17 00:00:00 2001 From: printempw Date: Fri, 18 Nov 2016 23:06:15 +0800 Subject: [PATCH] add event UserProfileUpdated --- app/Events/CheckPlayerExists.php | 10 --------- app/Events/GetAvatarPreview.php | 10 --------- app/Events/GetPlayerJson.php | 10 --------- app/Events/GetSkinPreview.php | 10 --------- app/Events/PlayerProfileUpdated.php | 10 --------- app/Events/UserProfileUpdated.php | 26 ++++++++++++++++++++++++ app/Http/Controllers/AdminController.php | 2 +- app/Http/Controllers/UserController.php | 3 +++ 8 files changed, 30 insertions(+), 51 deletions(-) create mode 100644 app/Events/UserProfileUpdated.php diff --git a/app/Events/CheckPlayerExists.php b/app/Events/CheckPlayerExists.php index 17def499..fddc6275 100644 --- a/app/Events/CheckPlayerExists.php +++ b/app/Events/CheckPlayerExists.php @@ -3,7 +3,6 @@ namespace App\Events; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class CheckPlayerExists extends Event { @@ -21,13 +20,4 @@ class CheckPlayerExists extends Event $this->player_name = $player_name; } - /** - * Get the channels the event should be broadcast on. - * - * @return array - */ - public function broadcastOn() - { - return []; - } } diff --git a/app/Events/GetAvatarPreview.php b/app/Events/GetAvatarPreview.php index 48c87409..8a99431c 100644 --- a/app/Events/GetAvatarPreview.php +++ b/app/Events/GetAvatarPreview.php @@ -3,7 +3,6 @@ namespace App\Events; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class GetAvatarPreview extends Event { @@ -24,13 +23,4 @@ class GetAvatarPreview extends Event $this->size = $size; } - /** - * Get the channels the event should be broadcast on. - * - * @return array - */ - public function broadcastOn() - { - return []; - } } diff --git a/app/Events/GetPlayerJson.php b/app/Events/GetPlayerJson.php index 9f356e0d..e2d0e4a9 100644 --- a/app/Events/GetPlayerJson.php +++ b/app/Events/GetPlayerJson.php @@ -4,7 +4,6 @@ namespace App\Events; use App\Models\Player; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class GetPlayerJson extends Event { @@ -25,13 +24,4 @@ class GetPlayerJson extends Event $this->api_type = $api_type; } - /** - * Get the channels the event should be broadcast on. - * - * @return array - */ - public function broadcastOn() - { - return []; - } } diff --git a/app/Events/GetSkinPreview.php b/app/Events/GetSkinPreview.php index 8f488d3b..8f4876b1 100644 --- a/app/Events/GetSkinPreview.php +++ b/app/Events/GetSkinPreview.php @@ -4,7 +4,6 @@ namespace App\Events; use App\Models\Texture; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class GetSkinPreview extends Event { @@ -25,13 +24,4 @@ class GetSkinPreview extends Event $this->size = $size; } - /** - * Get the channels the event should be broadcast on. - * - * @return array - */ - public function broadcastOn() - { - return []; - } } diff --git a/app/Events/PlayerProfileUpdated.php b/app/Events/PlayerProfileUpdated.php index 3a64e516..70b6f04b 100644 --- a/app/Events/PlayerProfileUpdated.php +++ b/app/Events/PlayerProfileUpdated.php @@ -4,7 +4,6 @@ namespace App\Events; use App\Models\Player; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class PlayerProfileUpdated extends Event { @@ -22,13 +21,4 @@ class PlayerProfileUpdated extends Event $this->player = $player; } - /** - * Get the channels the event should be broadcast on. - * - * @return array - */ - public function broadcastOn() - { - return []; - } } diff --git a/app/Events/UserProfileUpdated.php b/app/Events/UserProfileUpdated.php new file mode 100644 index 00000000..101f0d39 --- /dev/null +++ b/app/Events/UserProfileUpdated.php @@ -0,0 +1,26 @@ +type = $type; + $this->user = $user; + } + +} diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index bc76e097..3a55113b 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -44,7 +44,7 @@ class AdminController extends Controller $form->group('max_upload_file_size', '最大允许上传大小', function($group) { // main textbox - $group->text('max_upload_file_size'); + $group->text('max_upload_file_size', option('max_upload_file_size')); $group->addon('KB'); })->hint('PHP 限制:'.ini_get('post_max_size').',定义在 php.ini 中。'); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index e3a88de8..5823cd0e 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -8,6 +8,7 @@ use Utils; use App\Models\User; use App\Models\Texture; use Illuminate\Http\Request; +use App\Events\UserProfileUpdated; use App\Exceptions\PrettyPageException; use App\Services\Repositories\UserRepository; @@ -124,6 +125,8 @@ class UserController extends Controller break; } + event(new UserProfileUpdated($this->action, $this->user)); + } /**