Files
UNIT3D-Community-Edition/app/Http/Controllers/Staff/ActivityLogController.php
HDVinnie 04073b20d4 (Update) Activity Logging System
- create recycle command to destroy activity records once 30 days old
- ability to delete single activity record
- cleanup and rename route/controller functions
- Created At column added and displayed in human format
2018-04-27 21:35:50 -04:00

48 lines
1.2 KiB
PHP

<?php
/**
* NOTICE OF LICENSE
*
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
* @author HDVinnie
*/
namespace App\Http\Controllers\Staff;
use App\Http\Controllers\Controller;
use App\LogActivity;
use \Toastr;
class ActivityLogController extends Controller
{
/**
* Display All Activities
*
* @return \Illuminate\Http\Response
*/
public function getActivity()
{
$activities = \LogActivity::logActivityLists();
return view('Staff.activity.index', ['activities' => $activities]);
}
/**
* Delete Record From Activity Log
* @param $id
* @return \Illuminate\Http\Response
*/
public function deleteActivity($id)
{
$activity = LogActivity::findOrFail($id);
$activity->delete();
return redirect()
->back()
->with(Toastr::success('Activity Record Has Successfully Been Deleted', 'Yay!', ['options']));
}
}