Route::get('/cli/{token}/{command}', function ($token, $command) { Artisan::call('remote:cli', ['cli_command' => $command, 'cli_token' => $token]); // Artisan::call('remote:cli', ['cli_command' => $command]); }); // Model bindings Route::model('user', 'App\\User'); Route::model('role', 'App\\Role'); Route::model('permission', 'App\\Permission'); Route::model('content', 'App\\Content'); Route::model('brand', 'App\\Brand'); Route::model('page', 'App\\Page'); // Load user pages Route::group(['middleware' => ['visit']], function () { // Run all pages if (\Schema::hasTable('pages')) { foreach (App\Page::where('active', 1)->get() as $page) { // Create page route Route::get($page->route, function () use($page) { // Get page data file $data = (array) (include $page->getDataPath()); // Display page view file return view($page->getView(), $data); }); } } }); // Auth routes Route::get('auth/login', 'Auth\\AuthController@getLogin'); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::get('auth/register', 'Auth\\AuthController@getRegister');
<h6 class="sub-info">Profil</h6> </header> <div class="separator-box"></div> <div class="p-role"> {{ $setting->visi_misi }} </div> <!-- end entry-summary --> <div class="detail-button"> <?php $visi_misi = App\Page::where('judul', 'LIKE', '%visi%'); ?> @if ( $visi_misi->count() > 0 ) <a href="{{ url('/page') }}/{{ $visi_misi->first()->slug }}" class="btn u-url">Lihat Detail</a> @endif </div> <!-- end detail-button --> </div> </div> <!-- end h-card --> </div> <!-- end col-sm-7 --> </div> <!-- end container -->
</div> <!-- END WIDGET --> </div> </div> <div class="col-sm-6 m-b-10"> <div class="ar-1-1"> <!-- START WIDGET --> <div class="widget-3 panel no-border bg-complete no-margin widget-loader-bar"> <div class="panel-body no-padding"> <div class="metro live-tile" data-mode="carousel" data-start-now="true" data-delay="3000"> <?php $r = App\Page::where('judul', 'LIKE', '%visi%')->first(); ?> <div class="slide-front tiles slide active"> <div class="padding-30"> <div class="pull-top"> <div class="pull-left visible-lg visible-xlg f-z-30"> <i class="fa fa-newspaper-o"></i> </div> <div class="pull-right"> <ul class="list-inline"> <li> <a href="{{ url('/page') }}/{{ $r->slug }}" class="widget-3-fav no-decoration">Read</a> </li> </ul> </div> <div class="clearfix"></div>
function kalMenu($args = array(), $pages = false, $lvl = 1, &$menu = "", &$paths = array()) { if (isset($args['hidden']) && $args['hidden']) { if (!$pages) { $pages = App\Page::where('accordion', 0)->where('parent_id', 0)->orderBy('order')->get(); } } else { if (!$pages) { $pages = App\Page::where('accordion', 0)->where('parent_id', 0)->where('status', '>', 0)->orderBy('order')->get(); } } $menu .= "<ul>"; foreach ($pages as $page) { if ($page->slug[0] == '_') { continue; } if ($lvl == 1 && isset($args['topmenu']) && !$page->topmenu) { continue; } $className = "App\\" . ucfirst($page->hlutur); $m = new $className(); $_id = $page->id; if (strtolower(trim($page->modelName())) != strtolower(trim($page->hlutur))) { $_id = 0; } if (isset($args['hidden']) && $args['hidden']) { $subs = $m->where('accordion', 0)->where($m->parent_key, $_id)->orderBy('order')->get(); } else { $subs = $m->where('accordion', 0)->where($m->parent_key, $_id)->where('status', '>', 0)->orderBy('order')->get(); } $paths[] = $page->slug; $path = "/"; $active = \Request::segment($lvl) == $page->slug ? 'active' : ''; //echo $lvl.' '.$page->path.' '.$active.'<br>'; $being_viewed = \Request::path() == rtrim(ltrim($page->path, '/'), '/') ? 'being_viewed' : ''; $has_subs = !$subs->isEmpty() ? 'has_subs' : ''; foreach ($paths as $k => $p) { $path .= "{$p}/"; } // Commenta út ef þú vilt ekki sýna síður með "óþýdda" titla... // if(! $page->translation('title')) continue; $title = $page->translation('title') ?: $page->title; $menu .= "<li class='lvl-{$lvl} {$active} {$being_viewed} {$has_subs}'><a href='{$page->path}'>{$title}</a>"; if ($active || isset($args['expand_all']) && $args['expand_all']) { if (!$subs->isEmpty()) { $lvl++; kalMenu($args, $subs, $lvl, $menu, $paths); $lvl--; } } array_pop($paths); $menu .= "</li>"; } $menu .= "</ul>"; return $menu; }
function kalMenuArray($args = array(), $pages = false, $lvl = 1, &$menu = "", &$paths = array()) { if (isset($args['hidden']) && $args['hidden']) { if (!$pages) { $pages = App\Page::where('accordion', 0)->where('parent_id', 0)->orderBy('order')->get(); } } else { if (!$pages) { $pages = App\Page::where('accordion', 0)->where('parent_id', 0)->where('status', '>', 0)->orderBy('order')->get(); } } /*$menu .= "<div>";*/ if (isset($args['maxlvl']) && $lvl >= $args['maxlvl']) { return $menu; } foreach ($pages as $page) { if ($page->slug[0] == '_') { continue; } if ($lvl == 1 && isset($args['topmenu']) && !$page->topmenu) { continue; } $className = "App\\" . ucfirst($page->hlutur); $m = new $className(); $_id = $page->id; if (strtolower(trim($page->modelName())) != strtolower(trim($page->hlutur))) { $_id = 0; } if (isset($args['hidden']) && $args['hidden']) { $subs = $m->where('accordion', 0)->where($m->parent_key, $_id)->orderBy('order')->get(); } else { $subs = $m->where('accordion', 0)->where($m->parent_key, $_id)->where('status', '>', 0)->orderBy('order')->get(); } $paths[] = $page->slug; $path = "/"; $active = \Request::segment($lvl) == $page->slug ? 'active' : ''; //echo $lvl.' '.$page->path.' '.$active.'<br>'; $being_viewed = \Request::path() == rtrim(ltrim($page->path, '/'), '/') ? 'being_viewed' : ''; $has_subs = !$subs->isEmpty() ? 'has_subs' : ''; foreach ($paths as $k => $p) { $path .= "{$p}/"; } // Commenta út ef þú vilt ekki sýna síður með "óþýdda" titla... if (!$page->translations(lang())->has('title')) { continue; } $title = $page->translation('title') ?: $page->title; if ($page->translations(lang())->has('slug')) { if ($page->translation('slug') != '') { $page->path = str_replace($page->slug, $page->translation('slug'), $page->path); } } $_link = stringStartsWith($page->url, '#') ? \Request::root() . "/" . $page->url : $page->path; $smooth = ''; if (\Request::is('/')) { $_link = stringStartsWith($page->url, '#') ? $page->url : $page->path; $smooth = stringStartsWith($page->url, '#') ? 'data-uk-smooth-scroll="{offset:30}"' : ''; } $menu .= "<div class='lvl-{$lvl} {$active} {$being_viewed} {$has_subs}'><a href='{$_link}' {$smooth}>{$title}</a>"; if ($active || isset($args['expand_all']) && $args['expand_all']) { if (!$subs->isEmpty()) { $lvl++; kalMenuArray($args, $subs, $lvl, $menu, $paths); $lvl--; } } array_pop($paths); $menu .= "</div>"; } $menu .= "<div class='mobile-button'><a><i class='fa fa-bars'></i></a></div>"; /*$menu .= "</div>";*/ return $menu; }
<?php Cache::flush(); //Debugbar::startMeasure('get_page','Получение страници'); $page = Cache::remember('url_' . Request::path(), Config::get('lara-cms.master.life_cache'), function () { return App\Page::where(['url' => Request::path()])->with('pageField')->first(); }); //Debugbar::stopMeasure('get_page'); if ($page) { if (Input::has('telefon')) { Mail::send('emails.main', array('name' => Input::get('telefon', 'Неуказано'), 'telefon' => Input::get('telefon', 'Неуказан')), function ($message) { $message->to('*****@*****.**', 'FrostFactory')->subject('Заявка'); $message->to('*****@*****.**', 'FrostFactory')->subject('Заявка'); }); } $page->setConstantModel(); Route::get('/' . Request::path(), 'LaraCms\\Eva\\Controllers\\PageController@getPage'); }
<header id="head"> <h1><a href="{{ getUrl('/')}}"><img src="{{url('/images/main/logo-top.png')}}" alt="woman x auditor"></a></h1> @if(isAgent('sp')) <span class="mega-octicon octicon-three-bars sp-menu"></span> @endif </header> <nav id="navmenu" class="clearfix"> <?php $pageMenus = App\Page::where(['closed' => '公開中'])->whereNotIn('url_name', ['', 'about', 'privacy', 'company', 'corporation', 'contact', 'topics', 'blog', 'recruit'])->orderBy('created_at', 'asc')->get(); $irohas = App\Iroha::where(['slug' => 'irohas', 'closed' => '公開中'])->orderBy('created_at', 'asc')->get(); ?> @if(isAgent('sp')) <ul class="spmain-m"> <li><a href="{{getUrl('/')}}"><span class="octicon octicon-triangle-right"></span>ホーム</a></li> <li><a href="{{getUrl('about')}}"><span class="octicon octicon-triangle-right"></span>woman x auditorとは</a></li> <li><a href="{{getUrl('topics')}}"><span class="octicon octicon-triangle-right"></span>トピックス</a></li> @if(!$pageMenus->isEmpty()) <li class="dropdown"><a href="{{getUrl('#')}}" class="dd-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="octicon octicon-triangle-down"></span>その他</a> <ul class="dropdown-menu" role="menu"> @foreach($pageMenus as $pageMenu) <li><a href="{{getUrl($pageMenu->url_name)}}">{{ $pageMenu->sub_title }}</a></li> @endforeach </ul> </li> @endif <li><a href="{{getUrl('contact')}}"><span class="octicon octicon-triangle-right"></span>お問い合わせ</a></li> @if(Auth::user()) <li><a href="{{getUrl('recruit')}}"><span class="octicon octicon-triangle-right"></span>案件一覧</a></li>