Skip to content

Commit

Permalink
refactor(global): Routes file by module.
Browse files Browse the repository at this point in the history
Fixes
- Login page with refresh
- Fix image helper
  • Loading branch information
gnovaro committed Oct 2, 2023
1 parent ada318a commit 44f3e73
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 42 deletions.
2 changes: 1 addition & 1 deletion app/Helpers/ImageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class ImageHelper
{
public static function render(string $path): string
{
return isset($path) ? 'data:image/png;base64,'.base64_encode(file_get_contents($path)) : '';
return file_exists($path) ? 'data:image/png;base64,'.base64_encode(file_get_contents($path)) : '';
}
}
2 changes: 1 addition & 1 deletion resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.basic')

@section('content')
<link rel="preconnect" href="https://fonts.googleapis.com">
Expand Down
12 changes: 12 additions & 0 deletions routes/partials/calendar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use Illuminate\Support\Facades\Route;

Route::match(['get', 'post'], '/calendar/{date?}',
[\App\Http\Controllers\Calendar\CalendarController::class, 'index'])->name('calendar.index');
Route::post('/calendar/event/save', [\App\Http\Controllers\Calendar\SaveCalendarEventController::class, 'save'])
->name('calendar.save');
Route::get('/calendar/event/update/{id}',
[\App\Http\Controllers\Calendar\UpdateCalendarEventController::class, 'update'])->name('calendar.update');
Route::delete('/calendar/event/delete/{id}',
[\App\Http\Controllers\Calendar\DeleteCalendarEventController::class, 'delete'])->name('calendar.delete');
8 changes: 8 additions & 0 deletions routes/partials/campaign.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use Illuminate\Support\Facades\Route;

Route::match(['get', 'post'], '/campaign', [\App\Http\Controllers\Campaign\CampaignIndexController::class, 'index']);
Route::get('/campaign/create', [\App\Http\Controllers\Campaign\CampaignCreateController::class, 'create']);
Route::get('/campaign/update/{id}', [\App\Http\Controllers\Campaign\CampaignUpdateController::class, 'update']);
Route::post('/campaign/save', [\App\Http\Controllers\Campaign\CampaignSaveController::class, 'save']);
18 changes: 18 additions & 0 deletions routes/partials/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Illuminate\Support\Facades\Route;

Route::match(['get', 'post'], '/email', [\App\Http\Controllers\Email\EmailIndexController::class, 'index']);
Route::get('/email/create', [\App\Http\Controllers\Email\EmailCreateController::class, 'create']);
Route::get('/email/view/{id}', [\App\Http\Controllers\Email\EmailViewController::class, 'view']);
Route::get('/email/update/{id}', [\App\Http\Controllers\Email\EmailUpdateController::class, 'update']);
Route::post('/email/save', [\App\Http\Controllers\Email\EmailSaveController::class, 'save']);
Route::get('/email/send/{id}', [\App\Http\Controllers\Email\EmailSendController::class, 'send']);
Route::get('/email/delete/{id}', [\App\Http\Controllers\Email\EmailDeleteController::class, 'delete']);
Route::match(['get', 'post'], '/email/duplicate',
[\App\Http\Controllers\Email\EmailDuplicateController::class, 'duplicate'])
->name('email.duplicate');
Route::get('/email/download-attachment/{attachmentId}',
[\App\Http\Controllers\Email\EmailDownloadAttachmentController::class, 'downloadAttachment'])
->name('downloadAttachment');
Route::get('/email/tracking/{uuid}', [\App\Http\Controllers\Email\EmailTrackingController::class, 'track_email']);
12 changes: 12 additions & 0 deletions routes/partials/notification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use Illuminate\Support\Facades\Route;

Route::get('/notification', [\App\Http\Controllers\Notification\NotificationIndexController::class, 'index']);
Route::get('/ajax/notification', [\App\Http\Controllers\Notification\GetLatestAjaxController::class, 'getLatest'])
->middleware('auth');
Route::get('/notification/read/{id}',
[\App\Http\Controllers\Notification\SetNotificationReadAjaxController::class, 'setRead'])
->middleware('auth');
Route::get('/notification/delete/{id}',
[\App\Http\Controllers\Notification\DeleteNotificationController::class, 'delete']);
9 changes: 9 additions & 0 deletions routes/partials/user.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use Illuminate\Support\Facades\Route;

Route::get('/user', [\App\Http\Controllers\User\UserListController::class, 'index']);
Route::get('/user/create', [\App\Http\Controllers\User\UserCreateController::class, 'create']);
Route::get('/user/update/{id}', [\App\Http\Controllers\User\UserUpdateController::class, 'update']);
Route::post('/user/save', [\App\Http\Controllers\User\UserSaveController::class, 'save']);
Route::get('/user/delete/{id}', [\App\Http\Controllers\User\UserDeleteController::class, 'delete']);
44 changes: 5 additions & 39 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@
Route::post('/account/save', [\App\Http\Controllers\Account\AccountSaveController::class, 'save']);

// User
Route::get('/user', [\App\Http\Controllers\User\UserListController::class, 'index']);
Route::get('/user/create', [\App\Http\Controllers\User\UserCreateController::class, 'create']);
Route::get('/user/update/{id}', [\App\Http\Controllers\User\UserUpdateController::class, 'update']);
Route::post('/user/save', [\App\Http\Controllers\User\UserSaveController::class, 'save']);
Route::get('/user/delete/{id}', [\App\Http\Controllers\User\UserDeleteController::class, 'delete']);
require __DIR__.'/partials/user.php';

// Profile
Route::get('/profile', [\App\Http\Controllers\Profile\ProfileUpdateController::class, 'update']);
Expand All @@ -69,40 +65,17 @@
Route::get('/home', [\App\Http\Controllers\HomeController::class, 'index']);

// Calendar
Route::match(['get', 'post'], '/calendar/{date?}',
[\App\Http\Controllers\Calendar\CalendarController::class, 'index'])->name('calendar.index');
Route::post('/calendar/event/save', [\App\Http\Controllers\Calendar\SaveCalendarEventController::class, 'save'])
->name('calendar.save');
Route::get('/calendar/event/update/{id}',
[\App\Http\Controllers\Calendar\UpdateCalendarEventController::class, 'update'])->name('calendar.update');
Route::delete('/calendar/event/delete/{id}',
[\App\Http\Controllers\Calendar\DeleteCalendarEventController::class, 'delete'])->name('calendar.delete');
require __DIR__.'/partials/calendar.php';

// Email
Route::match(['get', 'post'], '/email', [\App\Http\Controllers\Email\EmailIndexController::class, 'index']);
Route::get('/email/create', [\App\Http\Controllers\Email\EmailCreateController::class, 'create']);
Route::get('/email/view/{id}', [\App\Http\Controllers\Email\EmailViewController::class, 'view']);
Route::get('/email/update/{id}', [\App\Http\Controllers\Email\EmailUpdateController::class, 'update']);
Route::post('/email/save', [\App\Http\Controllers\Email\EmailSaveController::class, 'save']);
Route::get('/email/send/{id}', [\App\Http\Controllers\Email\EmailSendController::class, 'send']);
Route::get('/email/delete/{id}', [\App\Http\Controllers\Email\EmailDeleteController::class, 'delete']);
Route::match(['get', 'post'], '/email/duplicate',
[\App\Http\Controllers\Email\EmailDuplicateController::class, 'duplicate'])
->name('email.duplicate');
Route::get('/email/download-attachment/{attachmentId}',
[\App\Http\Controllers\Email\EmailDownloadAttachmentController::class, 'downloadAttachment'])
->name('downloadAttachment');
Route::get('/email/tracking/{uuid}', [\App\Http\Controllers\Email\EmailTrackingController::class, 'track_email']);
require __DIR__.'/partials/email.php';

// Email template
Route::match(['get', 'post'], '/email-template',
[\App\Http\Controllers\EmailTemplate\EmailTemplateIndexController::class, 'index']);

// Campaign
Route::match(['get', 'post'], '/campaign', [\App\Http\Controllers\Campaign\CampaignIndexController::class, 'index']);
Route::get('/campaign/create', [\App\Http\Controllers\Campaign\CampaignCreateController::class, 'create']);
Route::get('/campaign/update/{id}', [\App\Http\Controllers\Campaign\CampaignUpdateController::class, 'update']);
Route::post('/campaign/save', [\App\Http\Controllers\Campaign\CampaignSaveController::class, 'save']);
require __DIR__.'/partials/campaign.php';

// Supplier
require __DIR__.'/partials/supplier.php';
Expand All @@ -122,14 +95,7 @@
Route::get('/web-form', [\App\Http\Controllers\WebForm\WebFormIndexController::class, 'index']);

// Notifications
Route::get('/notification', [\App\Http\Controllers\Notification\NotificationIndexController::class, 'index']);
Route::get('/ajax/notification', [\App\Http\Controllers\Notification\GetLatestAjaxController::class, 'getLatest'])
->middleware('auth');
Route::get('/notification/read/{id}',
[\App\Http\Controllers\Notification\SetNotificationReadAjaxController::class, 'setRead'])
->middleware('auth');
Route::get('/notification/delete/{id}',
[\App\Http\Controllers\Notification\DeleteNotificationController::class, 'delete']);
require __DIR__.'/partials/notification.php';

// Unsubscribe
Route::get('/unsubscribe', [\App\Http\Controllers\Unsubscribe\UnsubscribeUpdateController::class, 'update']);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

const APP_VERSION = '3.8.9';
const APP_VERSION = '3.8.10';

0 comments on commit 44f3e73

Please sign in to comment.