Skip to content

Commit d91b937

Browse files
committed
Laravel 5.4 upgrade
1 parent c7f7685 commit d91b937

File tree

304 files changed

+34102
-14567
lines changed

Some content is hidden

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

304 files changed

+34102
-14567
lines changed

.env.live

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APP_ENV=productionAPP_DEBUG=trueAPP_KEY=base64:xbpZ9i+Z/cFebsPXhrAnwzIdoQLFA7GZne/iC6bDKL4=APP_URL=http://bpocallaghan.co.za/PUBLIC_FOLDER=public_htmlAPP_TITLE="Titan"APP_DESCRIPTION="Awesome Admin Portal"APP_AUTHOR="Ben-Piet O'Callaghan"APP_KEYWORDS="titan awesome admin portal cms"DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=bpocasgt_titanDB_USERNAME=bpocasgt_adminDB_PASSWORD=6FDvkPMwFDK6}Mf812PoCACHE_DRIVER=fileSESSION_DRIVER=fileQUEUE_DRIVER=databaseREDIS_HOST=127.0.0.1REDIS_PASSWORD=nullREDIS_PORT=6379MAIL_DRIVER=mailgunMAIL_HOST=smtp.mailgun.orgMAIL_PORT=587MAIL_USERNAME=bpocallaghan@gmailcomMAIL_PASSWORD=nullMAIL_ENCRYPTION=nullMAIL_ADMIN="Ben-Piet O'Callaghan"MAIL_ADMIN_EMAIL="[email protected]"MAIL_NAME="Titan"[email protected]_SECRET=key-f05f2773140c5d89ddaf65e80ddc73a0MAILGUN_DOMAIN=bpocallaghan.co.zaFACEBOOK_APP_ID=1677524729160990RECAPTCHA_PUBLIC_KEY=6LfBNBwTAAAAAHqppepAnU6GQNbIPyv1NGObpt2xRECAPTCHA_PRIVATE_KEY=6LfBNBwTAAAAALJTGzeIjqLx76wUkDOlP_EeLZBsGOOGLE_ANALYTICS="UA-52694956-1"GOOGLE_MAP_KEY=AIzaSyBP1upSrIhapVgjswZtb125ZbXD_u4hooAANALYTICS_SITE_ID="ga:88378678"ANALYTICS_SERVICE_EMAIL="[email protected]"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ Homestead.json
99
Homestead.yaml
1010
npm-debug.log
1111
.env
12-
_ide_helper.php
1312
.phpstorm.meta.php
13+
_ide_helper.php
14+
public/mix-manifest.json
15+
storage/google-analytics.p12

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ A Laravel CMS Starter project with AdminLTE theme and core features.
1313
- Authorization
1414
- login / forgot password
1515
- register via authorization (admin invite user)
16-
- Dashboard
17-
- google analytics
18-
- list activities
16+
- Google Analytics Reports (with charts)
17+
- visitors
18+
- devices
19+
- keywords
20+
- pages
1921
- Admin Navigation
2022
- Website Navigation
21-
- Tag resource
23+
- Log Actions (if contact us was submitted, etc)
24+
- Notifications (Laravel 5.4 notifications)
2225
- Log Activities (user, resource, before, after)
2326
- Bootstrap Alerts and Form Error messages. package; bpocallaghan/alert
2427
- Flash a Notification after a CRUD resource action. package; bpocallaghan/notify

app/Events/ActionWasTriggered.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
class ActionWasTriggered extends BaseEvent
6+
{
7+
public $type;
8+
9+
public $message;
10+
11+
/**
12+
* Create a new event instance.
13+
* @param string $type
14+
* @param string $message
15+
* @param $subject
16+
*/
17+
public function __construct($type = '', $message = '', $subject)
18+
{
19+
$this->type = $type;
20+
$this->eloquent = $subject;
21+
$this->message = $message;
22+
}
23+
}

app/Events/BaseEvent.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
use Illuminate\Support\Facades\Event;
6+
use Illuminate\Queue\SerializesModels;
7+
8+
class BaseEvent extends Event
9+
{
10+
use SerializesModels;
11+
12+
public $eloquent;
13+
14+
/**
15+
* Get the channels the event should be broadcast on.
16+
*
17+
* @return array
18+
*/
19+
public function broadcastOn()
20+
{
21+
return [];
22+
}
23+
}

app/Events/ContactUsFeedback.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
use App\Events\Event;
6+
use App\Models\FeedbackContactUs;
7+
8+
class ContactUsFeedback extends BaseEvent
9+
{
10+
/**
11+
* Create a new event instance.
12+
*
13+
* @param FeedbackContactUs $row
14+
*/
15+
public function __construct(FeedbackContactUs $row)
16+
{
17+
$row->type = 'Contact Us';
18+
$this->eloquent = $row;
19+
}
20+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Admin;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Http\Requests;
8+
use App\Http\Controllers\Controller;
9+
use Titan\Controllers\TitanAdminController;
10+
11+
class AdminController extends TitanAdminController
12+
{
13+
14+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Admin;
4+
5+
use App\Http\Requests;
6+
7+
class AnalyticsController extends AdminController
8+
{
9+
public function summary()
10+
{
11+
return $this->view('analytics.summary');
12+
}
13+
14+
public function devices()
15+
{
16+
return $this->view('analytics.devices');
17+
}
18+
19+
public function visitsReferrals()
20+
{
21+
return $this->view('analytics.visits_referrals');
22+
}
23+
24+
public function interests()
25+
{
26+
return $this->view('analytics.interests');
27+
}
28+
29+
public function demographics()
30+
{
31+
return $this->view('analytics.demographics');
32+
}
33+
}

app/Http/Controllers/Admin/DashboardController.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22

33
namespace App\Http\Controllers\Admin;
44

5-
use App\Models\LogAdminActivity;
65
use Illuminate\Http\Request;
76

87
use App\Http\Requests;
9-
use LaravelAnalytics;
8+
use App\Http\Controllers\Controller;
109
use Titan\Controllers\TitanAdminController;
11-
use Titan\Controllers\Traits\Analytics;
1210

13-
class DashboardController extends TitanAdminController
11+
class DashboardController extends AdminController
1412
{
15-
use Analytics;
16-
17-
public function index()
18-
{
19-
$activities = LogAdminActivity::getLatest();
20-
21-
return $this->view('dashboard', compact('activities'));
22-
}
23-
}
13+
public function index()
14+
{
15+
return $this->view('dashboard');
16+
}
17+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Admin;
4+
5+
use Redirect;
6+
use App\Http\Requests;
7+
use App\Models\Banner;
8+
use Illuminate\Http\Request;
9+
use App\Http\Controllers\Admin\AdminController;
10+
use Titan\Controllers\Traits\UploadFile;
11+
12+
class BannersController extends AdminController
13+
{
14+
use UploadFile;
15+
16+
/**
17+
* Display a listing of banner.
18+
*
19+
* @return Response
20+
*/
21+
public function index()
22+
{
23+
save_resource_url();
24+
25+
return $this->view('banners.index')->with('items', Banner::all());
26+
}
27+
28+
/**
29+
* Show the form for creating a new banner.
30+
*
31+
* @return Response
32+
*/
33+
public function create()
34+
{
35+
return $this->view('banners.add_edit');
36+
}
37+
38+
/**
39+
* Store a newly created banner in storage.
40+
*
41+
* @param Request $request
42+
* @return Response
43+
*/
44+
public function store(Request $request)
45+
{
46+
$this->validate($request, Banner::$rules, Banner::$messages);
47+
48+
$photo = $this->uploadBanner($request->file('photo'));
49+
if ($photo) {
50+
$request->merge(['image' => $photo]);
51+
$banner = $this->createEntry(Banner::class, $request->except('photo'));
52+
}
53+
54+
log_action('Banner Created', 'Banner was created ' . $banner->title);
55+
56+
return redirect_to_resource();
57+
}
58+
59+
/**
60+
* Display the specified banner.
61+
*
62+
* @param Banner $banner
63+
* @return Response
64+
*/
65+
public function show(Banner $banner)
66+
{
67+
return $this->view('banners.show')->with('item', $banner);
68+
}
69+
70+
/**
71+
* Show the form for editing the specified banner.
72+
*
73+
* @param Banner $banner
74+
* @return Response
75+
*/
76+
public function edit(Banner $banner)
77+
{
78+
return $this->view('banners.add_edit')->with('item', $banner);
79+
}
80+
81+
/**
82+
* Update the specified banner in storage.
83+
*
84+
* @param Banner $banner
85+
* @param Request $request
86+
* @return Response
87+
*/
88+
public function update(Banner $banner, Request $request)
89+
{
90+
if (is_null($request->file('photo'))) {
91+
$this->validate($request, array_except(Banner::$rules, 'photo'), Banner::$messages);
92+
}
93+
else {
94+
$this->validate($request, Banner::$rules, Banner::$messages);
95+
96+
$photo = $this->uploadBanner($request->file('photo'));
97+
$request->merge(['image' => $photo]);
98+
}
99+
100+
$this->updateEntry($banner, $request->except('photo'));
101+
102+
log_action('Banner Updated', 'Banner was updated. ' . $banner->title);
103+
104+
return redirect_to_resource();
105+
}
106+
107+
/**
108+
* Remove the specified banner from storage.
109+
*
110+
* @param Banner $banner
111+
* @param Request $request
112+
* @return Response
113+
*/
114+
public function destroy(Banner $banner, Request $request)
115+
{
116+
$this->deleteEntry($banner, $request);
117+
118+
return redirect_to_resource();
119+
}
120+
}

0 commit comments

Comments
 (0)