Skip to content

Commit e685e60

Browse files
authored
Merge pull request #282 from viralsolani/develop
- Upgrade to Laravel 5.7 - Removed generator resources/vendor files - Resolved html flash <br/> in validation messages issue - updated fronted account section to remove address, state, city, ssn and zipcode as we are not using it anywhere - MISC API Changes - Fixed table names from faqs repository - Remove Email Template Module And implemented Mailable - Resolve Misc. Bug Fixes
2 parents 9f36ea7 + 6ab7db3 commit e685e60

File tree

48 files changed

+173
-1736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+173
-1736
lines changed

app/Events/Backend/EmailTemplates/EmailTemplateDeleted.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/Events/Backend/EmailTemplates/EmailTemplateUpdated.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/Exceptions/GeneralException.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,29 @@
99
*/
1010
class GeneralException extends Exception
1111
{
12+
/**
13+
* message.
14+
*
15+
* @var string
16+
*/
17+
public $message;
18+
19+
/**
20+
* dontHide.
21+
*
22+
* @var bool
23+
*/
24+
public $dontHide;
25+
26+
/**
27+
* Constructor function.
28+
*
29+
* @param string $message
30+
* @param bool $dontHide
31+
*/
32+
public function __construct($message, $dontHide = false)
33+
{
34+
$this->message = $message;
35+
$this->dontHide = $dontHide;
36+
}
1237
}

app/Exceptions/Handler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function report(Exception $exception)
5353
*/
5454
public function render($request, Exception $exception)
5555
{
56-
//dd($exception);
5756
if (strpos($request->url(), '/api/') !== false) {
5857
\Log::debug('API Request Exception - '.$request->url().' - '.$exception->getMessage().(!empty($request->all()) ? ' - '.json_encode($request->except(['password'])) : ''));
5958

@@ -112,6 +111,8 @@ public function render($request, Exception $exception)
112111
* All instances of GeneralException redirect back with a flash message to show a bootstrap alert-error
113112
*/
114113
if ($exception instanceof GeneralException) {
114+
session()->flash('dontHide', $exception->dontHide);
115+
115116
return redirect()->back()->withInput()->withFlashDanger($exception->getMessage());
116117
}
117118

app/Helpers/helpers.php

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

3-
use App\Exceptions\GeneralException;
43
use App\Helpers\uuid;
5-
use App\Http\Utilities\SendEmail;
64
use App\Models\Notification\Notification;
75
use App\Models\Settings\Setting;
86
use Carbon\Carbon as Carbon;
@@ -145,38 +143,25 @@ function settings()
145143
}
146144
}
147145

148-
// Creating Notification
149146
if (!function_exists('createNotification')) {
150147
/**
151148
* create new notification.
152149
*
153150
* @param $message message you want to show in notification
154151
* @param $userId To Whom You Want To send Notification
155-
* @param $type type of notification (1 - dashboard, 2 - email, 3 - both) (by default 1)
156-
* @param $option associate array [ 'data' => $data, 'email_template_type' => $template_type ]
157152
*
158153
* @return object
159154
*/
160-
function createNotification($message, $userId, $type = 1, $options = [])
155+
function createNotification($message, $userId)
161156
{
162-
if ($type == 1 || $type == 3) {
163-
$notification = new Notification();
157+
$notification = new Notification();
164158

165-
return $notification->insert([
166-
'message' => $message,
167-
'user_id' => $userId,
168-
'type' => $type,
169-
'created_at' => Carbon::now(),
170-
]);
171-
}
172-
if ($type == 2 || $type == 3) {
173-
if (!empty($options['data']) && !empty($options['email_template_type'])) {
174-
$mail = new SendEmail();
175-
$emailResult = $mail->sendWithTemplate($options['data'], $options['email_template_type']);
176-
} else {
177-
throw new GeneralException('Invalid input given.option array shold contains data and email_template_type');
178-
}
179-
}
159+
return $notification->insert([
160+
'message' => $message,
161+
'user_id' => $userId,
162+
'type' => 1,
163+
'created_at' => Carbon::now(),
164+
]);
180165
}
181166
}
182167

app/Http/Breadcrumbs/Backend/Backend.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
require __DIR__.'/Access/Role.php';
1010
require __DIR__.'/Access/Permission.php';
1111
require __DIR__.'/Page.php';
12-
require __DIR__.'/Email_Template.php';
1312
require __DIR__.'/Setting.php';
1413
require __DIR__.'/Blog_Category.php';
1514
require __DIR__.'/Blog_Tag.php';

app/Http/Breadcrumbs/Backend/Email_Template.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/Http/Controllers/Backend/EmailTemplates/EmailTemplatesController.php

Lines changed: 0 additions & 92 deletions
This file was deleted.

app/Http/Controllers/Backend/EmailTemplates/EmailTemplatesTableController.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

app/Http/Controllers/Backend/NotificationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class NotificationController extends Controller
1313
{
1414
/**
15-
* @var EmailTemplateContract
15+
* @var \App\Repositories\Backend\Notification\NotificationRepository
1616
*/
1717
protected $notification;
1818

0 commit comments

Comments
 (0)