Replaced Moment with Carbon #84
4 changed files with 10 additions and 5 deletions
|
@ -67,9 +67,10 @@ class IndexController extends Controller
|
|||
$title;
|
||||
$page = [];
|
||||
$views = [];
|
||||
$mode == 'edit' ? $page = $this->pages->getById($uuid)->first() : $page = [];
|
||||
$mode == 'edit' ? $page = $this->pages->getById($uuid) : $page = [];
|
||||
$mode == 'edit' ? $title = $page['title'] : $title = 'Add New';
|
||||
$mode == 'edit' ? $views = $this->themes->getCustomViews($page['layout']) : $views[] = 'page';
|
||||
|
||||
return view('back.page', [
|
||||
"status" => $this->auth::status(),
|
||||
"mode" => $mode,
|
||||
|
|
|
@ -45,7 +45,10 @@ class PageRepository implements PageRepositoryInterface
|
|||
|
||||
public function getById($uuid)
|
||||
{
|
||||
return $this->pages->where('uuid', $uuid);
|
||||
$page = $this->pages->where('uuid', $uuid)->first();
|
||||
//quick check to see if layout is set
|
||||
$page['layout'] == '' ? $page['layout'] = 'page' : $page['layout'] = $page['layout'];
|
||||
return $page;
|
||||
}
|
||||
|
||||
public function delete($uuid)
|
||||
|
@ -74,6 +77,7 @@ class PageRepository implements PageRepositoryInterface
|
|||
$file;
|
||||
$writePath;
|
||||
$message;
|
||||
$deleted;
|
||||
if ($task != 'create') {
|
||||
$path = date('Y', date($page['rawCreated'])) .
|
||||
'/' .
|
||||
|
|
|
@ -155,7 +155,7 @@ class DocService
|
|||
$object->menu .
|
||||
"\n" .
|
||||
'published: ' .
|
||||
$object->menu .
|
||||
$object->published .
|
||||
"\n" .
|
||||
'featured: ' .
|
||||
$object->featured .
|
||||
|
|
|
@ -44,7 +44,7 @@ class ThemeService
|
|||
{
|
||||
$currentTheme = $this->settings->getGlobal()['theme'];
|
||||
$folder = '../content/themes/' . $currentTheme;
|
||||
$files = array_filter(glob("$folder/*twig"), 'is_file');
|
||||
$files = array_filter(glob("$folder/*blade.php"), 'is_file');
|
||||
$views = [];
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
@ -62,7 +62,7 @@ class ThemeService
|
|||
{
|
||||
$currentTheme = $this->settings->getGlobal()['theme'];
|
||||
$folder = '../content/themes/' . $currentTheme;
|
||||
$files = array_filter(glob("$folder/*twig"), 'is_file');
|
||||
$files = array_filter(glob("$folder/*blade.php"), 'is_file');
|
||||
$views = [];
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
|
Loading…
Add table
Reference in a new issue