Skip to content

Commit 65ab50a

Browse files
committed
added admin routing and admin php info mvc's
1 parent 4c3d441 commit 65ab50a

15 files changed

+199
-33
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Laravel 5.4 with user authentication, registration with email confirmation, soci
5353
|User Password Reset via Email Token|
5454
|User Login with remember password|
5555
|User roles implementation|
56+
|Admin Routing Details UI|
57+
|Admin PHP Information UI|
5658
|Eloquent user profiles|
5759
|User Themes|
5860
|404 Page|
@@ -146,6 +148,9 @@ npm install
146148

147149
#### Admin Tools Routes
148150
* ```/logs```
151+
* ```/php```
152+
* ```/routes```
153+
149154

150155
### Socialite
151156

@@ -325,6 +330,8 @@ INSTAGRAM_REDIRECT_URI=http://laravel-auth.local/social/handle/instagram
325330
* https://laravel.com/docs/5.4/errors
326331
327332
###### Updates:
333+
* Added Admin Routing Details
334+
* Admin PHP Information
328335
* Added Robust [Laravel Logging](https://laravel.com/docs/5.4/errors#logging) with admin UI using MonoLog
329336
* Added Active Nav states using [Laravel Requests](https://laravel.com/docs/5.4/requests)
330337
* Added [Laravel Debugger](https://github.com/barryvdh/laravel-debugbar) with Service Provider to manage status in `.env` file.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
use Illuminate\Support\Facades\Route;
7+
use App\Http\Requests;
8+
use File;
9+
10+
class AdminDetailsController extends Controller
11+
{
12+
13+
/**
14+
* Create a new controller instance.
15+
*
16+
* @return void
17+
*/
18+
public function __construct()
19+
{
20+
$this->middleware('auth');
21+
}
22+
23+
/**
24+
* Display a listing of the resource.
25+
*
26+
* @return \Illuminate\Http\Response
27+
*/
28+
public function listRoutes()
29+
{
30+
$routes = Route::getRoutes();
31+
$data = [
32+
'routes' => $routes
33+
];
34+
35+
return view('pages.admin.route-details', $data);
36+
}
37+
38+
public function listPHPInfo()
39+
{
40+
return view('pages.admin.php-details');
41+
}
42+
43+
}

public/css/app.1e901db56615a997fdf1.css

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/css/app.e3d440c5f94fc35318a5.css

-8
This file was deleted.

public/mix-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"/js/app.js": "/js/app.1136fcfd9dc71ebd00e6.js",
3-
"/css/app.css": "/css/app.e3d440c5f94fc35318a5.css"
3+
"/css/app.css": "/css/app.1e901db56615a997fdf1.css"
44
}

resources/assets/sass/_badges.scss

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.badge {
2+
&.badge-primary {
3+
background-color: $brand-primary;
4+
}
5+
}
6+
7+
// A Good time for an @extend
8+
.panel-default > .panel-heading {
9+
.badge {
10+
&.badge-primary {
11+
background-color: $brand-primary;
12+
}
13+
}
14+
}

resources/assets/sass/_forms.scss

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@
1212
.active {
1313
color: green;
1414
}
15+
1516
.switch {
1617
cursor: pointer;
18+
1719
.fa {
1820
vertical-align: -5px;
1921
margin-right: .25em;
2022
}
23+
2124
.active {
2225
display: none;
2326
}
27+
2428
input[type="radio"] {
2529
position: relative;
2630
z-index: -1;
@@ -32,10 +36,9 @@
3236
.inactive {
3337
display: none;
3438
}
35-
3639
}
37-
3840
}
41+
3942
.disabled {
4043
color: #dcdbdb;
4144
pointer-events: none;
@@ -46,5 +49,4 @@
4649
pointer-events: none;
4750
cursor: not-allowed;
4851
}
49-
5052
}

resources/assets/sass/_logs.scss

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.logs-container {
2+
.stack {
3+
font-size: 0.85em;
4+
}
5+
.date {
6+
min-width: 75px;
7+
}
8+
.text {
9+
word-break: break-all;
10+
}
11+
a.llv-active {
12+
z-index: 2;
13+
background-color: $brand-primary;
14+
border-color: $brand-primary;
15+
color: $white;
16+
17+
.badge {
18+
background: $white;
19+
color: $text-color;
20+
margin-top: .2em;
21+
}
22+
}
23+
}

resources/assets/sass/app.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
// Buttons
3131
@import "buttons";
3232

33+
// Badges
34+
@import "badges";
35+
3336
// Components
3437
@import "modals";
3538

@@ -43,4 +46,7 @@
4346
@import "lists";
4447

4548
// Avatars
46-
@import "avatar";
49+
@import "avatar";
50+
51+
// Logs
52+
@import "logs";

resources/lang/en/titles.php

+2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
'adminThemesAdd' => 'Add New Theme',
2828

2929
'adminLogs' => 'Log Files',
30+
'adminPHP' => 'PHP Information',
31+
'adminRoutes' => 'Routing Details',
3032

3133
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@extends('layouts.app')
2+
3+
@section('template_title')
4+
PHP Information
5+
@endsection
6+
7+
@section('content')
8+
<div class="container">
9+
<div class="row">
10+
<div class="col-md-12">
11+
<div class="panel panel-default">
12+
<div class="panel-heading">
13+
PHP Information
14+
</div>
15+
<div class="panel-body">
16+
<div class="table-responsive">
17+
@php
18+
phpinfo();
19+
@endphp
20+
</div>
21+
</div>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
@endsection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@extends('layouts.app')
2+
3+
@section('template_title')
4+
Routing Information
5+
@endsection
6+
7+
@section('content')
8+
<div class="container">
9+
<div class="row">
10+
<div class="col-md-12">
11+
12+
@include('partials.form-status')
13+
14+
<div class="panel panel-default">
15+
<div class="panel-heading">
16+
Routing Information
17+
<span class="badge badge-primary pull-right">{{ count($routes) }} routes</span>
18+
</div>
19+
<div class="panel-body">
20+
<div class="table-responsive">
21+
<table class="table table-striped table-condensed data-table">
22+
<thead>
23+
<tr class="success">
24+
<th>URI</th>
25+
<th>Name</th>
26+
<th>Type</th>
27+
<th>Method</th>
28+
</tr>
29+
</thead>
30+
<tbody>
31+
@foreach ($routes as $route)
32+
<tr>
33+
<td>{{$route->uri}}</td>
34+
<td>{{$route->getName()}}</td>
35+
<td>{{$route->getPrefix()}}</td>
36+
<td>{{$route->getActionMethod()}}</td>
37+
</tr>
38+
@endforeach
39+
</tbody>
40+
</table>
41+
</div>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
@endsection

resources/views/partials/nav.blade.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<li {{ Request::is('users/create') ? 'class=active' : null }}>{!! HTML::link(url('/users/create'), Lang::get('titles.adminNewUser')) !!}</li>
3030
<li {{ Request::is('themes','themes/create') ? 'class=active' : null }}>{!! HTML::link(url('/themes'), Lang::get('titles.adminThemesList')) !!}</li>
3131
<li {{ Request::is('logs') ? 'class=active' : null }}>{!! HTML::link(url('/logs'), Lang::get('titles.adminLogs')) !!}</li>
32+
<li {{ Request::is('php') ? 'class=active' : null }}>{!! HTML::link(url('/php'), Lang::get('titles.adminPHP')) !!}</li>
33+
<li {{ Request::is('routes') ? 'class=active' : null }}>{!! HTML::link(url('/routes'), Lang::get('titles.adminRoutes')) !!}</li>
3234
</ul>
3335
</li>
3436
@endrole
@@ -71,4 +73,4 @@
7173
</ul>
7274
</div>
7375
</div>
74-
</nav>
76+
</nav>

resources/views/vendor/laravel-log-viewer/log.blade.php

+11-19
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,30 @@
77
@section('template_linked_css')
88

99
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css">
10-
<style type="text/css">
11-
.stack {
12-
font-size: 0.85em;
13-
}
14-
.date {
15-
min-width: 75px;
16-
}
17-
.text {
18-
word-break: break-all;
19-
}
20-
a.llv-active {
21-
z-index: 2;
22-
background-color: #f5f5f5;
23-
border-color: #777;
24-
}
25-
</style>
10+
2611
@endsection
2712

2813
@section('content')
2914

30-
<div class="container-fluid">
15+
<div class="container-fluid logs-container">
3116
<div class="row">
17+
3218
<div class="col-sm-3 col-md-2 sidebar">
33-
<h4><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> Log Files</h4>
19+
<h4><span class="fa fa-fw fa-file-code-o" aria-hidden="true"></span> Log Files</h4>
3420
<div class="list-group">
3521
@foreach($files as $file)
3622
<a href="?l={{ base64_encode($file) }}" class="list-group-item @if ($current_file == $file) llv-active @endif">
3723
{{$file}}
24+
@if ($current_file == $file)
25+
<span class="badge pull-right">
26+
{{ count($logs) }}
27+
</span>
28+
@endif
3829
</a>
3930
@endforeach
4031
</div>
4132
</div>
33+
4234
<div class="col-sm-9 col-md-10 table-container">
4335
@if ($logs === null)
4436
<div>
@@ -55,7 +47,6 @@
5547
</tr>
5648
</thead>
5749
<tbody>
58-
5950
@foreach($logs as $key => $log)
6051
<tr>
6152
<td class="text-{{{$log['level_class']}}}"><span class="glyphicon glyphicon-{{{$log['level_img']}}}-sign" aria-hidden="true"></span> &nbsp;{{$log['level']}}</td>
@@ -86,6 +77,7 @@
8677
@endif
8778
</div>
8879
</div>
80+
8981
</div>
9082
</div>
9183

routes/web.php

+2
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,7 @@
9696
]);
9797

9898
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
99+
Route::get('php', 'AdminDetailsController@listPHPInfo');
100+
Route::get('routes', 'AdminDetailsController@listRoutes');
99101

100102
});

0 commit comments

Comments
 (0)