Set the dashboard home title in its own blade, and bump a row's timestamp after uploading an image or file

This commit is contained in:
Kevin MacMartin 2018-04-23 23:15:54 -04:00
parent 10f11f8480
commit 8c0dc48d2d
2 changed files with 10 additions and 10 deletions

View file

@ -19,17 +19,15 @@ class DashboardController extends Controller {
} }
/** /**
* Show the application dashboard * Dashboard home
*/ */
public function getIndex() public function getIndex()
{ {
return view('dashboard.home', [ return view('dashboard.home');
'heading' => 'Dashboard Home'
]);
} }
/** /**
* Show the dashboard credits * Project credits
*/ */
public function getCredits() public function getCredits()
{ {
@ -237,11 +235,11 @@ class DashboardController extends Controller {
file::makeDirectory($directory, 0755, true, true); file::makeDirectory($directory, 0755, true, true);
$image = Image::make($request->file('file')); $image = Image::make($request->file('file'));
$image->save($directory . $request['id'] . '-' . $request['name'] . '.jpg'); $image->save($directory . $request['id'] . '-' . $request['name'] . '.jpg');
$item->touch();
return 'success';
} else { } else {
return 'file-upload-fail'; return 'file-upload-fail';
} }
return 'success';
} else { } else {
return 'model-access-fail'; return 'model-access-fail';
} }
@ -272,11 +270,11 @@ class DashboardController extends Controller {
$directory = base_path() . '/public/uploads/' . $request['model'] . '/files/'; $directory = base_path() . '/public/uploads/' . $request['model'] . '/files/';
file::makeDirectory($directory, 0755, true, true); file::makeDirectory($directory, 0755, true, true);
$request->file('file')->move($directory, $request['id'] . '-' . $request['name'] . '.' . $request['ext']); $request->file('file')->move($directory, $request['id'] . '-' . $request['name'] . '.' . $request['ext']);
$item->touch();
return 'success';
} else { } else {
return 'file-upload-fail'; return 'file-upload-fail';
} }
return 'success';
} else { } else {
return 'model-access-fail'; return 'model-access-fail';
} }

View file

@ -1,4 +1,6 @@
@extends('dashboard.core') @extends('dashboard.core', [
'heading' => 'Dashboard Home'
])
@section('dashboard-body') @section('dashboard-body')
<div class="list-group menu-list"> <div class="list-group menu-list">