Ejemplo n.º 1
0
 public static function getLogo()
 {
     $getLogoQuery = Settings::where('item', '=', 'maintenance_settings')->get();
     foreach ($getLogoQuery as $value) {
         if (Settings::find($value->id)->logo) {
             return Settings::find($value->id)->logo->getPath();
         }
     }
 }
Ejemplo n.º 2
0
<?php

use Cms\Classes\Page;
use Backend\Facades\BackendAuth;
use ShahiemSeymor\Maintenance\Models\Settings;
Route::get('/maintenance-example', function () {
    return View::make('shahiemseymor.maintenance::page')->with(Settings::getSettingsArray());
});
App::before(function ($request) {
    $backendPrefix = str_replace('/', '', Config::get('cms.backendUri', 'backend'));
    if (!Request::is($backendPrefix . '/*') && !Request::is($backendPrefix)) {
        if (Settings::get('maintenance') == TRUE && !BackendAuth::check()) {
            Route::any('{all}', function ($slug) {
                return View::make('shahiemseymor.maintenance::page')->with(Settings::getSettingsArray());
            })->where('all', '(.*)?');
        }
    }
});
 public function render()
 {
     return $this->makePartial('widget', ['maintenanceStatus' => Settings::get('maintenance')]);
 }