Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for laravel 7 #284

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"require": {
"luketowers/purifier": "~3.0"
"mews/purifier": "^3.2"
},
"require-dev": {
"illuminate/cache": "~5.1.20|5.2.*|5.3.*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
Expand Down
5 changes: 3 additions & 2 deletions src/ChatterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace DevDojo\Chatter;

use Illuminate\Support\ServiceProvider;
use Mews\Purifier\PurifierServiceProvider;

class ChatterServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -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');
}
Expand Down
8 changes: 4 additions & 4 deletions src/Controllers/ChatterDiscussionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ public function show($category, $slug = null)
}

$discussion->increment('views');

return view('chatter::discussion', compact('discussion', 'posts', 'chatter_editor'));
}

Expand Down
6 changes: 3 additions & 3 deletions src/Controllers/ChatterPostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down