From 998ef4e4f1259340e4baac627f626b6bf75ea9e5 Mon Sep 17 00:00:00 2001 From: Mohammad Hafijul Islam Date: Fri, 1 Mar 2024 02:10:36 +0600 Subject: [PATCH] transaction repo updated --- composer.json | 4 +++- src/ChatServiceProvider.php | 3 --- src/Repositories/Eloquent/ChatGroupRepository.php | 8 +------- src/Repositories/Eloquent/ChatMessageRepository.php | 8 +------- src/Repositories/Eloquent/ChatParticipantRepository.php | 8 +------- 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 2ffb1e5..fedbebf 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,9 @@ "extra": { "laravel": { "providers": [ - "Fintech\\Chat\\ChatServiceProvider" + "Fintech\\Chat\\ChatServiceProvider", + "Fintech\\Chat\\RepositoryServiceProvider", + "Fintech\\Chat\\RouteServiceProvider" ], "aliases": { "Chat": "Fintech\\Chat\\Facades\\Chat" diff --git a/src/ChatServiceProvider.php b/src/ChatServiceProvider.php index 8f89bb2..b4e220c 100644 --- a/src/ChatServiceProvider.php +++ b/src/ChatServiceProvider.php @@ -18,9 +18,6 @@ public function register() $this->mergeConfigFrom( __DIR__ . '/../config/chat.php', 'fintech.chat' ); - - $this->app->register(RouteServiceProvider::class); - $this->app->register(RepositoryServiceProvider::class); } /** diff --git a/src/Repositories/Eloquent/ChatGroupRepository.php b/src/Repositories/Eloquent/ChatGroupRepository.php index b7b1663..8bfe5d9 100644 --- a/src/Repositories/Eloquent/ChatGroupRepository.php +++ b/src/Repositories/Eloquent/ChatGroupRepository.php @@ -16,13 +16,7 @@ class ChatGroupRepository extends EloquentRepository implements InterfacesChatGr { public function __construct() { - $model = app(config('fintech.chat.chat_group_model', ChatGroup::class)); - - if (!$model instanceof Model) { - throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance."); - } - - $this->model = $model; + parent::__construct(config('fintech.chat.chat_group_model', ChatGroup::class)); } /** diff --git a/src/Repositories/Eloquent/ChatMessageRepository.php b/src/Repositories/Eloquent/ChatMessageRepository.php index 9d8f626..3e7e595 100644 --- a/src/Repositories/Eloquent/ChatMessageRepository.php +++ b/src/Repositories/Eloquent/ChatMessageRepository.php @@ -16,13 +16,7 @@ class ChatMessageRepository extends EloquentRepository implements InterfacesChat { public function __construct() { - $model = app(config('fintech.chat.chat_message_model', ChatMessage::class)); - - if (!$model instanceof Model) { - throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance."); - } - - $this->model = $model; + parent::__construct(config('fintech.chat.chat_message_model', ChatMessage::class)); } /** diff --git a/src/Repositories/Eloquent/ChatParticipantRepository.php b/src/Repositories/Eloquent/ChatParticipantRepository.php index aeeceb8..4f6ec60 100644 --- a/src/Repositories/Eloquent/ChatParticipantRepository.php +++ b/src/Repositories/Eloquent/ChatParticipantRepository.php @@ -16,13 +16,7 @@ class ChatParticipantRepository extends EloquentRepository implements Interfaces { public function __construct() { - $model = app(config('fintech.chat.chat_participant_model', ChatParticipant::class)); - - if (!$model instanceof Model) { - throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance."); - } - - $this->model = $model; + parent::__construct(config('fintech.chat.chat_participant_model', ChatParticipant::class)); } /**