Skip to content

Commit

Permalink
Layout Changes (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
NuwanJ authored Apr 1, 2024
1 parent 302e3bc commit c8f6b77
Show file tree
Hide file tree
Showing 69 changed files with 630 additions and 687 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ composer.lock
/.idea
_ide_helper.php
.phpstorm.meta.php

.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function store(StoreRoleRequest $request)
{
$this->roleService->store($request->validated());

return redirect()->route('admin.auth.role.index')->withFlashSuccess(__('The role was successfully created.'));
return redirect()->route('dashboard.auth.role.index')->withFlashSuccess(__('The role was successfully created.'));
}

/**
Expand Down Expand Up @@ -95,7 +95,7 @@ public function update(UpdateRoleRequest $request, Role $role)
{
$this->roleService->update($role, $request->validated());

return redirect()->route('admin.auth.role.index')->withFlashSuccess(__('The role was successfully updated.'));
return redirect()->route('dashboard.auth.role.index')->withFlashSuccess(__('The role was successfully updated.'));
}

/**
Expand All @@ -109,6 +109,6 @@ public function destroy(DeleteRoleRequest $request, Role $role)
{
$this->roleService->destroy($role);

return redirect()->route('admin.auth.role.index')->withFlashSuccess(__('The role was successfully deleted.'));
return redirect()->route('dashboard.auth.role.index')->withFlashSuccess(__('The role was successfully deleted.'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public function update(Request $request, User $user, $status)
$this->userService->mark($user, (int) $status);

return redirect()->route(
(int) $status === 1 || ! $request->user()->can('admin.access.user.reactivate') ?
'admin.auth.user.index' :
(int) $status === 1 || !$request->user()->can('admin.access.user.reactivate') ?
'dashboard.auth.user' :
'admin.auth.user.deactivated'
)->withFlashSuccess(__('The user was successfully updated.'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function update(User $deletedUser)
{
$this->userService->restore($deletedUser);

return redirect()->route('admin.auth.user.index')->withFlashSuccess(__('The user was successfully restored.'));
return redirect()->route('dashboard.auth.user.index')->withFlashSuccess(__('The user was successfully restored.'));
}

/**
Expand All @@ -58,6 +58,6 @@ public function destroy(User $deletedUser)

$this->userService->destroy($deletedUser);

return redirect()->route('admin.auth.user.deleted')->withFlashSuccess(__('The user was permanently deleted.'));
return redirect()->route('dashboard.auth.user.deleted')->withFlashSuccess(__('The user was permanently deleted.'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function store(StoreUserRequest $request)
{
$user = $this->userService->store($request->validated());

return redirect()->route('admin.auth.user.show', $user)->withFlashSuccess(__('The user was successfully created.'));
return redirect()->route('dashboard.auth.user.show', $user)->withFlashSuccess(__('The user was successfully created.'));
}

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ public function update(UpdateUserRequest $request, User $user)
{
$this->userService->update($user, $request->validated());

return redirect()->route('admin.auth.user.show', $user)->withFlashSuccess(__('The user was successfully updated.'));
return redirect()->route('dashboard.auth.user.show', $user)->withFlashSuccess(__('The user was successfully updated.'));
}

/**
Expand All @@ -128,6 +128,6 @@ public function destroy(DeleteUserRequest $request, User $user)
{
$this->userService->delete($user);

return redirect()->route('admin.auth.user.deleted')->withFlashSuccess(__('The user was successfully deleted.'));
return redirect()->route('dashboard.auth.user.deleted')->withFlashSuccess(__('The user was successfully deleted.'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public function update(UpdateUserPasswordRequest $request, User $user)
{
$this->userService->updatePassword($user, $request->validated());

return redirect()->route('admin.auth.user.index')->withFlashSuccess(__('The user\'s password was successfully updated.'));
return redirect()->route('dashboard.auth.user.index')->withFlashSuccess(__('The user\'s password was successfully updated.'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public function destroy(DisableTwoFactorAuthenticationRequest $request)
{
$request->user()->disableTwoFactorAuth();

return redirect()->route('frontend.user.account', ['#two-factor-authentication'])->withFlashSuccess(__('Two Factor Authentication Successfully Disabled'));
return redirect()->route('intranet.user.account', ['#two-factor-authentication'])->withFlashSuccess(__('Two Factor Authentication Successfully Disabled'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function update(UpdatePasswordRequest $request, UserService $userService)

$userService->updatePassword($request->user(), $request->only('old_password', 'password'), true);

return redirect()->route('frontend.user.account')
return redirect()->route('intranet.user.account')
->withFlashSuccess(__('Password successfully updated.'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public function update(UpdatePasswordRequest $request)
{
$this->userService->updatePassword($request->user(), $request->validated());

return redirect()->route('frontend.user.account', ['#password'])->withFlashSuccess(__('Password successfully updated.'));
return redirect()->route('intranet.user.account', ['#password'])->withFlashSuccess(__('Password successfully updated.'));
}
}
10 changes: 5 additions & 5 deletions app/Helpers/Global/GeneralHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Carbon\Carbon;

if (! function_exists('appName')) {
if (!function_exists('appName')) {
/**
* Helper to grab the application name.
*
Expand All @@ -14,7 +14,7 @@ function appName()
}
}

if (! function_exists('carbon')) {
if (!function_exists('carbon')) {
/**
* Create a new Carbon instance from a time.
*
Expand All @@ -29,7 +29,7 @@ function carbon($time)
}
}

if (! function_exists('homeRoute')) {
if (!function_exists('homeRoute')) {
/**
* Return the route to the "home" page depending on authentication/authorization status.
*
Expand All @@ -39,11 +39,11 @@ function homeRoute()
{
if (auth()->check()) {
if (auth()->user()->isAdmin()) {
return 'admin.dashboard';
return 'dashboard.home';
}

if (auth()->user()->isUser()) {
return 'frontend.user.dashboard';
return 'intranet.user.index';
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Backend/AnnouncementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function store(Request $request)
$announcement->enabled = ($request->enabled != null);
$announcement->save();

return redirect()->route('admin.announcements.index', $announcement)->with('Success', 'Announcement was created !');
return redirect()->route('dashboard.announcements.index', $announcement)->with('Success', 'Announcement was created !');
} catch (\Exception $ex) {
return abort(500);
}
Expand Down Expand Up @@ -84,7 +84,7 @@ public function update(Request $request, Announcement $announcement)
try {
$announcement->enabled = ($request->enabled != null);
$announcement->update($data);
return redirect()->route('admin.announcements.index')->with('Success', 'Announcement was updated !');
return redirect()->route('dashboard.announcements.index')->with('Success', 'Announcement was updated !');
} catch (\Exception $ex) {
return abort(500);
}
Expand Down Expand Up @@ -112,7 +112,7 @@ public function destroy(Announcement $announcement)
{
try {
$announcement->delete();
return redirect()->route('admin.announcements.index')->with('Success', 'Announcement was deleted !');
return redirect()->route('dashboard.announcements.index')->with('Success', 'Announcement was deleted !');
} catch (\Exception $ex) {
return abort(500);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Frontend/User/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class DashboardController
*/
public function index()
{
return view('frontend.user.dashboard');
return view('frontend.user.intranet');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Frontend/User/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function update(UpdateProfileRequest $request, UserService $userService)
return redirect()->route('frontend.auth.verification.notice')->withFlashInfo(__('You must confirm your new e-mail address before you can go any further.'));
}

return redirect()->route('frontend.user.account', ['#information'])->withFlashSuccess(__('Profile successfully updated.'));
return redirect()->route('intranet.user.account', ['#information'])->withFlashSuccess(__('Profile successfully updated.'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Kernel extends HttpKernel
/*
* This is configurable, disable boilerplate.access.user.admin_requires_2fa instead of removing this
*/
'2fa:enabled',
// '2fa:enabled',
'auth',
'password.expires',
'is_admin',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "rappasoft/laravel-boilerplate",
"name": "cepdnaclk/portal-ce-pdn-ac-lk",
"type": "project",
"description": "The Laravel Boilerplate Project.",
"keywords": [
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
39 changes: 20 additions & 19 deletions resources/views/backend/announcements/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

@section('content')
<div>
{!! Form::open(['url' => route('admin.announcements.store'),
{!! Form::open([
'url' => route('dashboard.announcements.store'),
'method' => 'post',
'class' => 'container',
'files'=>true,
'enctype'=>'multipart/form-data'
'files' => true,
'enctype' => 'multipart/form-data',
]) !!}

<x-backend.card>
Expand All @@ -19,12 +20,12 @@
<x-slot name="body">
<!-- Area -->
<div class="form-group row">
{!! Form::label('area', 'Area*', ['class' => 'col-md-2 col-form-label']) !!}
{!! Form::label('area', 'Area*', ['class' => 'col-md-2 col-form-label']) !!}

<div class="col-md-10">
{!! Form::select('area', $areas, null, ['class'=>'form-control', 'required'=>true, 'placeholder' => '']) !!}
{!! Form::select('area', $areas, null, ['class' => 'form-control', 'required' => true, 'placeholder' => '']) !!}
@error('area')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
Expand All @@ -34,9 +35,9 @@
{!! Form::label('type', 'Type*', ['class' => 'col-md-2 col-form-label']) !!}

<div class="col-md-10">
{!! Form::select('type', $types, null, ['class'=>'form-control', 'required'=>true, 'placeholder' => '']) !!}
{!! Form::select('type', $types, null, ['class' => 'form-control', 'required' => true, 'placeholder' => '']) !!}
@error('type')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
Expand All @@ -46,9 +47,9 @@
{!! Form::label('message', 'Display Message*', ['class' => 'col-md-2 col-form-label']) !!}

<div class="col-md-10">
{!! Form::textarea('message', '', ['class'=>'form-control', 'rows'=>3, 'required'=>true, ]) !!}
{!! Form::textarea('message', '', ['class' => 'form-control', 'rows' => 3, 'required' => true]) !!}
@error('message')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
Expand All @@ -58,21 +59,21 @@
{!! Form::label('enabled', 'Enabled*', ['class' => 'col-md-2 form-check-label']) !!}

<div class="col-md-4 form-check">
{!! Form::checkbox('enabled', '1', ['class'=>'form-check-input', 'required'=>true,]) !!}
{!! Form::checkbox('enabled', '1', ['class' => 'form-check-input', 'required' => true]) !!}
@error('enabled')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
</div>

<!-- Starts at -->
<div class="form-group row">
{!! Form::label('starts_at', 'Starts at*', ['class' => 'col-md-2 col-form-label']) !!}

<div class="col-md-4">
{!! Form::datetimeLocal('starts_at', '', ['class'=>'form-control', 'required'=>true,]) !!}
{!! Form::datetimeLocal('starts_at', '', ['class' => 'form-control', 'required' => true]) !!}
@error('starts_at')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
Expand All @@ -82,20 +83,20 @@
{!! Form::label('ends_at', 'Ends at*', ['class' => 'col-md-2 col-form-label']) !!}

<div class="col-md-4">
{!! Form::datetimeLocal('ends_at', '', ['class'=>'form-control', 'required'=>true,]) !!}
{!! Form::datetimeLocal('ends_at', '', ['class' => 'form-control', 'required' => true]) !!}
@error('ends_at')
<strong>{{ $message }}</strong>
<strong>{{ $message }}</strong>
@enderror
</div>
</div>
</x-slot>

<x-slot name="footer">
{!! Form::submit('Create', ['class'=>'btn btn-primary float-right']) !!}
{!! Form::submit('Create', ['class' => 'btn btn-primary float-right']) !!}
</x-slot>

</x-backend.card>

{!! Form::close() !!}
</div>
@endsection
@endsection
16 changes: 10 additions & 6 deletions resources/views/backend/announcements/delete.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@
<div>
<x-backend.card>
<x-slot name="header">
Announcements : Delete | {{ $announcement->id }}
Announcements : Delete | {{ $announcement->id }}
</x-slot>

<x-slot name="body">
<p>Are you sure you want to delete
<strong><i>"{{ $announcement->message }}"</i></strong> ?
<strong><i>"{{ $announcement->message }}"</i></strong> ?
</p>
<div class="d-flex">
{!! Form::open(['url' => route('admin.announcements.destroy', compact('announcement') ), 'method' => 'delete', 'class' => 'container']) !!}
{!! Form::open([
'url' => route('dashboard.announcements.destroy', compact('announcement')),
'method' => 'delete',
'class' => 'container',
]) !!}

<a href="{{ route('admin.announcements.index') }}" class="btn btn-light mr-2">Back</a>
{!! Form::submit('Delete', ['class'=>'btn btn-danger']) !!}
<a href="{{ route('dashboard.announcements.index') }}" class="btn btn-light mr-2">Back</a>
{!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}

{!! Form::close() !!}
</div>
</x-slot>
</x-backend.card>
</div>
@endsection
@endsection
Loading

0 comments on commit c8f6b77

Please sign in to comment.