New Year Flash Sale Offer 45% OFF Shop Now

Documentation

Installation

# Creating a LaraPress CMS Project

Before creating your first LaraPress project, make sure that your local machine has PHP and Composer installed.

After you have installed PHP and Composer, you may create a new LaraPress project via Composer's create-project command:

----------------------------------------------------------

↓    composer create-project larapresscms/larapress myproject

-----------------------------------------------------------

Once the project has been created, start LaraPress local development server using:

--------------------

https://localhost/myproject

-------------------

No Need Laravel Artisan's serve command.

Here is the video tutorial:

How to make theme?

== Folder Stucture==

  • -resources/views/front/themes
  • --default /theme name
  • ---layouts/master.blade.php //main master file of headerfooter
  • ---index.blade.php //main home page or blog/post list
  • ---page.blade.php //page
  • ---sidebar.blade.php //sidebar is all widgets
  • ---single.blade.php //details of blog
  • ---slider.blade.php //home page top slider
master.blade.php
 <html>
 <head>
  <link href="{{ asset('front/css/styles.css')}}" rel="stylesheet" />//all site assets is 'public/front' folder
 </head>
 <body>
  //when login user show username
  @auth()
   Profile ({{ optional(auth()->user())->name}})
  @endauth
 //its guest mode
  @guest()
  @endguest

  @yield('content')                                 //main content

 </body>
</html>
index.blade.php
  • @Extends('front.themes.default.layouts.master') // 'default' its a theme name
  • @Section('content')
    • @include('front.themes.default.slider') //if want to enable slider in index page
  • @foreach($posts as $post)
  • {{$post->thumbnail_path}}
  • {{ $post->created_at }}
  • {{ $post->title }}
  • {!! $post->excerpt !!}
  • @endforeach
  • {!! $posts->links() !!} //pagination
  • @include('front.themes.default.sidebar') //sidebar
  • @endsection
page.blade.php
  • @Extends('front.themes.default.layouts.master')
  • @Section('content')
  • {{ $page->title }}
  • {!! $page->content !!}
  • @endsection
single.blade.php
  • @Extends('front.themes.default.layouts.master')
  • @Section('content')
  • {{ $post->title }}
  • {{ $post->thumbnail_path }}
  • {{ $post->created_at }}
  • {!! $post->content !!}
  • @include('front.themes.default.sidebar')
  • @endsection
sidebar.blade.php

sideber widget

slider.blade.php
  • @php $data = 0; @endphp
  • @foreach($sliders as $slider)
  • {{ $data == 0? 'active':''}}
  • {{ $slider->title }}
  • {{ $slider->short_des }}
  • @php $data++ @endphp
  • @endforeach
All Routing
  • {{ url('/dashboard')}} //admin page
  • {{ url('/logout')}}
  • {{ url('/login')}}
  • {{ url('/register')}}
  • {{ url('single/'.$post->id) }} //all details of single page link
  • {{$post->thumbnail_path}} //single page thumbnails
  • {{ $page->thumbnail_path }}