Skip to content

Commit c62c99f

Browse files
committed
Rename LogAction - LogActivity
1 parent 84a1416 commit c62c99f

File tree

19 files changed

+223
-186
lines changed

19 files changed

+223
-186
lines changed

app/Events/ActionWasTriggered.php

Lines changed: 0 additions & 23 deletions
This file was deleted.
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 ActivityWasTriggered extends BaseEvent
6+
{
7+
public $title;
8+
9+
public $description;
10+
11+
/**
12+
* Create a new event instance.
13+
* @param string $title
14+
* @param string $description
15+
* @param $subject
16+
*/
17+
public function __construct($title = '', $description = '', $subject = null)
18+
{
19+
$this->title = $title;
20+
$this->eloquent = $subject;
21+
$this->description = $description;
22+
}
23+
}

app/Http/Controllers/Admin/General/BannersController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function store(Request $request)
5151
$banner = $this->createEntry(Banner::class, $request->except('photo'));
5252
}
5353

54-
log_action('Banner Created', 'Banner was created ' . $banner->title);
54+
log_activity('Banner Created', 'Banner was created ' . $banner->title);
5555

5656
return redirect_to_resource();
5757
}
@@ -99,7 +99,7 @@ public function update(Banner $banner, Request $request)
9999

100100
$this->updateEntry($banner, $request->except('photo'));
101101

102-
log_action('Banner Updated', 'Banner was updated. ' . $banner->title);
102+
log_activity('Banner Updated', 'Banner was updated. ' . $banner->title);
103103

104104
return redirect_to_resource();
105105
}

app/Http/Controllers/Admin/General/TestimonialsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function store(Request $request)
4545
$testimonial = $this->createEntry(Testimonial::class,
4646
$request->only(['customer', 'link', 'description']));
4747

48-
log_action('Testimonial Created', 'Testimonial was created ' . $testimonial->customer);
48+
log_activity('Testimonial Created', 'Testimonial was created ' . $testimonial->customer);
4949

5050
return redirect_to_resource();
5151
}
@@ -85,7 +85,7 @@ public function update(Testimonial $testimonial, Request $request)
8585

8686
$this->updateEntry($testimonial, $request->only(['customer', 'link', 'description']));
8787

88-
log_action('Testimonial Updated', 'Testimonial was updated. ' . $testimonial->customer);
88+
log_activity('Testimonial Updated', 'Testimonial was updated. ' . $testimonial->customer);
8989

9090
return redirect_to_resource();
9191
}

app/Http/Controllers/Admin/History/HistoryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace App\Http\Controllers\Admin\History;
44

55
use App\Http\Requests;
6-
use App\Models\LogAction;
6+
use App\Models\LogActivity;
77
use App\Models\LogAdminActivity;
88
use Titan\Controllers\TitanAdminController;
99

1010
class HistoryController extends TitanAdminController
1111
{
1212
public function website()
1313
{
14-
$actions = LogAction::getLatest();
14+
$actions = LogActivity::getLatest();
1515

1616
return $this->view('history.website', compact('actions'));
1717
}

app/Http/Controllers/Admin/Settings/Website/ChangelogsController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function store(Request $request)
4444

4545
$changelog = $this->createEntry(Changelog::class, $request->only(['version', 'date_at', 'content']));
4646

47-
log_action('Changelog Updated', 'Changelog was updated. ' . $changelog->version);
47+
log_activity('Changelog Updated', 'Changelog was updated. ' . $changelog->version);
4848

4949
return redirect_to_resource();
5050
}
@@ -84,7 +84,7 @@ public function update(Changelog $changelog, Request $request)
8484

8585
$this->updateEntry($changelog, $request->only(['version', 'date_at', 'content']));
8686

87-
log_action('Changelog Updated', 'Changelog was updated. ' . $changelog->version);
87+
log_activity('Changelog Updated', 'Changelog was updated. ' . $changelog->version);
8888

8989
return redirect_to_resource();
9090
}
@@ -100,7 +100,7 @@ public function destroy(Changelog $changelog, Request $request)
100100
{
101101
$this->deleteEntry($changelog, $request);
102102

103-
log_action('Changelog deleted', 'Changelog was deleted.');
103+
log_activity('Changelog deleted', 'Changelog was deleted.');
104104

105105
return redirect_to_resource();
106106
}

app/Http/Controllers/Api/NotificationsController.php

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

33
namespace App\Http\Controllers\Api;
44

5-
use App\Models\LogAction;
5+
use App\Models\LogActivity;
66
use App\Models\Notification;
77
use App\User;
88
use Illuminate\Http\Request;
@@ -69,13 +69,13 @@ public function read(User $user, Notification $notification)
6969
*/
7070
public function getLatestActions()
7171
{
72-
$activities = LogAction::getLatestMinutes(12 * 60);
72+
$activities = LogActivity::getLatestMinutes(12 * 60);
7373

7474
$items = [];
7575
foreach ($activities as $k => $item) {
7676
$items [] = [
77-
'title' => $item->type,
78-
'message' => $item->message,
77+
'title' => $item->title,
78+
'message' => $item->description,
7979
'created_at' => $item->created_at->diffForHumans(),
8080
];
8181
}

app/Http/Controllers/Auth/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private function sendLoginResponse(Request $request)
117117

118118
$this->clearLoginAttempts($request);
119119

120-
log_action('Login', user()->fullname . ' logged in.');
120+
log_activity('Login', user()->fullname . ' logged in.');
121121

122122
return redirect()->intended('/admin');
123123
}

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function ($message) use ($user) {
7272
alert()->success('Thank you,',
7373
'your account has been created, please check your inbox for further instructions.');
7474

75-
log_action('User Registered',
75+
log_activity('User Registered',
7676
$user->fullname . ' registered on ' . Carbon::now()->format('d M Y'), $user);
7777

7878
return redirect(route('login'));
@@ -98,15 +98,15 @@ public function confirmRegister($token)
9898

9999
alert()->success('Success', 'Congratulations, your account has been activated');
100100

101-
log_action('User Confirmed',
101+
log_activity('User Confirmed',
102102
$user->fullname . ' confirmed account ' . Carbon::now()->format('d M Y'),
103103
$user);
104104
}
105105
}
106106
else {
107107
alert()->error('Whoops!', 'Sorry, the token does not exist');
108108

109-
log_action('User Confirmed', 'INVALID TOKEN');
109+
log_activity('User Confirmed', 'INVALID TOKEN');
110110
}
111111

112112
return redirect(route('login'));

app/Listeners/EmailContactUsToAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function handle(ContactUsFeedback $event)
2626
$user->notify(new ContactUsSubmitted($data));
2727
}
2828

29-
log_action('Contact Us', $data->fullname . ' submitted Contact Us.', $data);
29+
log_activity('Contact Us', $data->fullname . ' submitted Contact Us.', $data);
3030
//Mail::send('emails.contactus_admin', ['obj' => $data], function ($message) use ($data) {
3131
// $message = mail_to_admins($message);
3232
// $message->subject($data->type . ' - ' . env('app.name'));

0 commit comments

Comments
 (0)