diff --git a/composer.json b/composer.json index ea6d98fb..f4f30594 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ } ], "require": { - "luketowers/purifier": "~3.0" + "mews/purifier": "^3.2" }, "require-dev": { "illuminate/cache": "~5.1.20|5.2.*|5.3.*", diff --git a/database/migrations/2016_07_29_171118_create_chatter_categories_table.php b/database/migrations/2016_07_29_171118_create_chatter_categories_table.php index 0323235e..e3d3207b 100755 --- a/database/migrations/2016_07_29_171118_create_chatter_categories_table.php +++ b/database/migrations/2016_07_29_171118_create_chatter_categories_table.php @@ -8,8 +8,8 @@ class CreateChatterCategoriesTable extends Migration public function up() { Schema::create('chatter_categories', function (Blueprint $table) { - $table->increments('id'); - $table->integer('parent_id')->unsigned()->nullable(); + $table->id('id'); + $table->bigInteger('parent_id')->unsigned()->nullable(); $table->integer('order')->default(1); $table->string('name'); $table->string('color', 20); diff --git a/database/migrations/2016_07_29_171118_create_chatter_discussion_table.php b/database/migrations/2016_07_29_171118_create_chatter_discussion_table.php index d6415300..e7ea364f 100755 --- a/database/migrations/2016_07_29_171118_create_chatter_discussion_table.php +++ b/database/migrations/2016_07_29_171118_create_chatter_discussion_table.php @@ -8,10 +8,10 @@ class CreateChatterDiscussionTable extends Migration public function up() { Schema::create('chatter_discussion', function (Blueprint $table) { - $table->increments('id'); - $table->integer('chatter_category_id')->unsigned()->default('1'); + $table->id('id'); + $table->bigInteger('chatter_category_id')->unsigned()->default('1'); $table->string('title'); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); $table->boolean('sticky')->default(false); $table->integer('views')->unsigned()->default('0'); $table->boolean('answered')->default(0); diff --git a/database/migrations/2016_07_29_171118_create_chatter_post_table.php b/database/migrations/2016_07_29_171118_create_chatter_post_table.php index cb943d04..e18c1957 100755 --- a/database/migrations/2016_07_29_171118_create_chatter_post_table.php +++ b/database/migrations/2016_07_29_171118_create_chatter_post_table.php @@ -8,9 +8,9 @@ class CreateChatterPostTable extends Migration public function up() { Schema::create('chatter_post', function (Blueprint $table) { - $table->increments('id'); - $table->integer('chatter_discussion_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->id('id'); + $table->bigInteger('chatter_discussion_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); $table->text('body'); $table->timestamps(); }); diff --git a/database/migrations/2017_01_16_121747_create_chatter_user_discussion_pivot_table.php b/database/migrations/2017_01_16_121747_create_chatter_user_discussion_pivot_table.php index e8a4f553..fc4df72c 100644 --- a/database/migrations/2017_01_16_121747_create_chatter_user_discussion_pivot_table.php +++ b/database/migrations/2017_01_16_121747_create_chatter_user_discussion_pivot_table.php @@ -13,9 +13,9 @@ class CreateChatterUserDiscussionPivotTable extends Migration public function up() { Schema::create('chatter_user_discussion', function (Blueprint $table) { - $table->integer('user_id')->unsigned()->index(); + $table->bigInteger('user_id')->unsigned()->index(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - $table->integer('discussion_id')->unsigned()->index(); + $table->bigInteger('discussion_id')->unsigned()->index(); $table->foreign('discussion_id')->references('id')->on('chatter_discussion')->onDelete('cascade'); $table->primary(['user_id', 'discussion_id']); }); diff --git a/src/ChatterServiceProvider.php b/src/ChatterServiceProvider.php index e6394ac4..48f7f15b 100644 --- a/src/ChatterServiceProvider.php +++ b/src/ChatterServiceProvider.php @@ -3,6 +3,7 @@ namespace DevDojo\Chatter; use Illuminate\Support\ServiceProvider; +use Mews\Purifier\PurifierServiceProvider; class ChatterServiceProvider extends ServiceProvider { @@ -48,13 +49,13 @@ public function register() /* * Register the service provider for the dependency. */ - $this->app->register(\LukeTowers\Purifier\PurifierServiceProvider::class); + $this->app->register(PurifierServiceProvider::class); /* * Create aliases for the dependency. */ $loader = \Illuminate\Foundation\AliasLoader::getInstance(); - $loader->alias('Purifier', 'LukeTowers\Purifier\Facades\Purifier'); + $loader->alias('Purifier', 'Mews\Purifier\Facades\Purifier'); $this->loadViewsFrom(__DIR__.'/Views', 'chatter'); } diff --git a/src/Controllers/ChatterDiscussionController.php b/src/Controllers/ChatterDiscussionController.php index 4a3be3e3..9b9ccef0 100644 --- a/src/Controllers/ChatterDiscussionController.php +++ b/src/Controllers/ChatterDiscussionController.php @@ -75,9 +75,9 @@ public function store(Request $request) 'body_content.min' => trans('chatter::alert.danger.reason.content_min'), 'chatter_category_id.required' => trans('chatter::alert.danger.reason.category_required'), ]); - - Event::fire(new ChatterBeforeNewDiscussion($request, $validator)); + + Event::dispatch(new ChatterBeforeNewDiscussion($request, $validator)); if (function_exists('chatter_before_new_discussion')) { chatter_before_new_discussion($request, $validator); } @@ -149,7 +149,7 @@ public function store(Request $request) $post = Models::post()->create($new_post); if ($post->id) { - Event::fire(new ChatterAfterNewDiscussion($request, $discussion, $post)); + Event::dispatch(new ChatterAfterNewDiscussion($request, $discussion, $post)); if (function_exists('chatter_after_new_discussion')) { chatter_after_new_discussion($request); } @@ -217,7 +217,7 @@ public function show($category, $slug = null) } $discussion->increment('views'); - + return view('chatter::discussion', compact('discussion', 'posts', 'chatter_editor')); } diff --git a/src/Controllers/ChatterPostController.php b/src/Controllers/ChatterPostController.php index 96aa1ba0..733740ff 100644 --- a/src/Controllers/ChatterPostController.php +++ b/src/Controllers/ChatterPostController.php @@ -56,7 +56,7 @@ public function store(Request $request) 'body.min' => trans('chatter::alert.danger.reason.content_min'), ]); - Event::fire(new ChatterBeforeNewResponse($request, $validator)); + Event::dispatch(new ChatterBeforeNewResponse($request, $validator)); if (function_exists('chatter_before_new_response')) { chatter_before_new_response($request, $validator); } @@ -97,8 +97,8 @@ public function store(Request $request) if ($new_post->id) { $discussion->last_reply_at = $discussion->freshTimestamp(); $discussion->save(); - - Event::fire(new ChatterAfterNewResponse($request, $new_post)); + + Event::dispatch(new ChatterAfterNewResponse($request, $new_post)); if (function_exists('chatter_after_new_response')) { chatter_after_new_response($request); }