Ejemplo n.º 1
0
 public function run()
 {
     $faker = Faker\Factory::create('ru_RU');
     $category = Category::all()->first();
     $type = Type::all()->first();
     $page = Page::create(['in_menu' => false, 'published' => true, 'sidebar_in_layout' => false, 'title' => $faker->word, 'content' => $faker->paragraphs(), 'type_id' => $type]);
     $page->save();
     $page->category()->attach($category);
 }
Ejemplo n.º 2
0
 public function readEntry($type, $id)
 {
     $type = $this->getType($type);
     $model = Page::where('type_id', $type->id)->where('id', $id)->first();
     return \View::make('scms::' . $model->layout->path, compact('model', 'type'));
 }
Ejemplo n.º 3
0
<?php

$pages = \Hlogeon\Scms\Models\Page::where('in_menu', true)->where('published', true)->get();
$types = \Hlogeon\Scms\Models\Type::where('type_in_menu', true)->get();
$menuItems = \Hlogeon\Scms\Models\MenuItem::where('published', true)->get();
$routePrefix = config('scms.route_prefix') !== '' ? config('scms.route_prefix') . '.' : '';
$pageRoute = $routePrefix . config('scms.read.alias');
$typeRoute = $routePrefix . config('scms.list.alias');
?>
<div class="adm-path">
    <span class="n-pull"></span>
    <ul class="path-list">
        @foreach($pages as $page)
            <li><a href="{{route($pageRoute, ['id' => $page->id, 'model' => $page->type_id])}}">{{{$page->title}}}</a></li>
        @endforeach
        @foreach($types as $type)
            <li><a href="{{route($typeRoute, ['model' => $type->id])}}">{{{$type->name}}}</a></li>
        @endforeach
        @foreach($menuItems as $item)
            <li><a href="{{url($item->url)}}">{{{$item->name}}}</a></li>
        @endforeach
        <li><a href="#">Продукт</a></li>
        <li><a href="#">Клиенты</a></li>
        <li><a href="#">Компания</a></li>
        {{--<li><a href="{{route('blog.home')}}">Блог</a></li>--}}
        {{--        <li><a href="{{route('case.list')}}">Кейсы</a></li>--}}
        {{--        <li><a href="{{route('content.list')}}">Контент</a></li>--}}
        {{--        <li><a href="{{route('area.list')}}">Сферы бизнеса</a></li>--}}
    </ul>
    <div class="add-btns">
        <a href="#" class="help">Помощь</a>