Quick intro to Laravel using a custom CMS app I made

Related tags

CMS l4cms
Overview

Quick intro to Laravel using a custom CMS app I made

intro

This is mainly to show an example of a small CMS being built in Laravel. CMS (Content Management System) that is at it's most basic level, Authentication, Simple Content Types etc.

What we will cover.

  • Installing the "CMS" and what Page Types it comes with
  • Looking at the folder layout "Where is...."
  • App config setting up the site
  • PHP Artisan command to migrate the site
  • Routes
  • Page example looking at the wysiwyg, Controller, View etc
  • Tags - lets add a many to many relationship

This is NOT the end all setup just an example. There are links below to quality videos, blogs posts docs etc to take you to the next level, not only in Laravel but just Object Oriented Design and good Architecture in general.

Note the theme has it's own license and you need to purchase it here in order to use it.

Install the "CMS" and what Page Types it comes with

The repo is here https://github.com/alnutile/cms

In time I will add more features but it really is an app that was made for a client that the base of it I wanted to fork off for later use.

Run the basic laravel install steps noted on their site http://laravel.com/docs/quick

What Page Types

  • Pages are the main landing pages for most of the site with a slug to manage the url [1]. More on Pages shortly.
  • Portfolios was how this project started. Basically you make One and then make projects that reference it.
  • Projects are just that. They fit in a Portfolio
  • Menu Sorting there is an admin area for menu sorting as well. Right now it is just for the top left menu. (not the black top nav)

All these "Admin" links can be seen below

admin_bar

Every landing page is a Page

Every URLs is Page, Project or Portfolio so the editor can always edit the description of the page even if there is a "collection" under it. For example /all_projects is a Page that just happens to also show a collection of "Projects" under it. Ideally this will be a less hard coded relationship BUT this particular example just needed a simple data set.

There are Portfolio and Project pages as well that the edit can edit the description on etc.

Looking at the folder layout

This is a standard Laravel App. The one key folder is app/CMS for some items. But otherwise the Controllers, Models etc have all the needed data. [2]

In app/CMS there is the Menu Facade, and the MenuService to make managing the menu system easier. [3]

The system puts it's uploaded files under public/img in settings, banners etc

App config setting up the site

The app default to sqlite and the bootstrap/start.php will default to local without you needing to set anything.

Running migrations will get you a good sample set of data. You can always turn this off in app/database/seeds

In the app/database/seeds/UsersTableSeeder.php file is the admin and test user emails and passwords to login.

Routes

The app/routes.php is where you can manage routes and see what is there right now.

Page Example

You can edit a page or add a page.

Once in there you will see this

image_page_edit

You can give the page a title, SEO title, upload images and files via the wysiwyg and set the slug (Published coming soon so there can be a workflow)

Tags

There is a tagging feature that does not yet have the UI setup. (coming soon). The resource is setup but needs to be placed in the view

In php artisan tinker we can mess around with tags thought

tags()->save($tag); Portfolio::find(1)->tags->toArray(); Tag::find(1)->portfolios->toArray(); Portfolio::find(1)->tags()->detach(1); Portfolio::find(1)->tags()->attach(1); ">

php artisan tinker
$tag = new Tag(['name' => "Test 4"]);
Portfolio::find(1)->tags()->save($tag);
Portfolio::find(1)->tags->toArray();
Tag::find(1)->portfolios->toArray();
Portfolio::find(1)->tags()->detach(1);
Portfolio::find(1)->tags()->attach(1);

So we are making a tag, saving it to Portfolio 1. Seeing it attached to Portfolio 1 and Seeing Portfolios attached to it.

Links

Footnotes

[1] This will be refactored shortly [2] This will be moved shortly to make it way more extendable but leaving the core easy to manage. [3] Refactor this out so menu is a manyToMany relationship with the models that will use it.

You might also like...
Flextype is an open-source Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS
Flextype is an open-source Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS

Flextype is an open-source Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS. Building this Content Management System, we focused on simplicity. To achieve this, we implemented a simple but powerful API's.

PHPVibe Open source video CMS / Video Sharing CMS / Youtube Api v3 / Video Embeds
PHPVibe Open source video CMS / Video Sharing CMS / Youtube Api v3 / Video Embeds

PHPVibe Video CMS Free Video Sharing CMS The modern choice of design inspired by Youtube and a social videos sharing module that may just cut it for y

BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the project website for more information.

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

Baicloud CMS is a lightweight content management system (CMS) based on PHP and MySQL and running on Linux, windows and other platforms

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

GetSimple CMS - a flatfile CMS that works fast and efficient and has the best UI around, it is written in PHP

GetSimple CMS is a flatfile CMS that works fast and efficient and has the best UI around, it is written in PHP.

Edit richt text content in Craft CMS using Article by Imperavi.

Article Editor About the plugin This plugin brings the powerful Article Editor from Imperavi to Craft CMS, allowing you to make create beautiful rich

 Simple Content Management System (CMS) Blog Using Codeigniter with Hierarchical Model View Controller (HMVC) Architectural
Simple Content Management System (CMS) Blog Using Codeigniter with Hierarchical Model View Controller (HMVC) Architectural

Simple Content Management System (CMS) Blog Using Codeigniter with Hierarchical Model View Controller (HMVC) Architectural This is my source code trai

📦 A CMS Panel using Phalcon Framework
📦 A CMS Panel using Phalcon Framework

Sakura panel , A script made with PHP ( Phalcon FrameWork ) and can run on both apache and nginx or any php service.

Owner
Alfred Nutile
see https://alfrednutile.info/#about
Alfred Nutile
Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.

Grafite CMS Grafite has archived this project and no longer supports or develops this code. We recommend using only as a source of ideas for your own

Grafite Inc 494 Nov 25, 2022
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. /// Chat with us and others on Spectrum: https://spectrum.chat/twill

About Twill Twill is an open source Laravel package that helps developers rapidly create a custom CMS that is beautiful, powerful, and flexible. By st

AREA 17 3k Jan 6, 2023
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond.

About Craft CMS Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. It features: An intuitive, user-

Craft CMS 2.9k Jan 1, 2023
SoyCMS Trivial - Lightweight and easy-to-use CMS. ( the custom version based on soycms. )

SoyCMS Trivial Author arbk (https://aruo.net/) Licensed under the GPLv2 license Version 3.1.3-t0 DESCRIPTION SoyCMS Trivial is an open source web cont

arbk 1 Oct 18, 2021
underthecoconuttree.site made with October CMS, scss, uikit.

October is a Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again. It was born out of

Joseph Jotkowitz 1 Oct 11, 2021
A slim, lean forum package designed for quick and easy integration in Laravel projects

Complete documentation is available on teamteatime.net. Installation Requires Laravel 6+ and PHP 7.4+. Step 1: Install the package Install the package

TeamTeaTime 486 Dec 31, 2022
Amila Laravel CMS - Free, open-source Simple Bootstrap Laravel CMS

Simple Bootstrap Laravel CMS. Support Laravel 8.x Can integrate into any existing Laravel project. Only add few database tables with prefixes, not affect your existing database tables. Support Laravel 7.x & Laravel 6.x & Laravel 5.x & MySql & PostgreSql - Amila Laravel CMS

Alex Zeng 96 Sep 6, 2022
A quick-and-dirty implementation based on Drupal 9

Help2022 - powered by Drupal 9 / Docksal This is a quick-and-dirty implementation based on Drupal 9 - full running version see here

Help2022.com 2 Mar 5, 2022
Doptor CMS is a Laravel 5 based CMS

Introduction Doptor CMS is a Laravel 5 based CMS. Find out more about Doptor by reading below. ;) About Doptor CMS Doptor is an Integrated and well-de

DOPTOR 4 Sep 11, 2022
Bootstrap CMS - PHP CMS powered by Laravel 5 and Sentry

Bootstrap CMS Bootstrap CMS was created by, and is maintained by Graham Campbell, and is a PHP CMS powered by Laravel 5.1 and Sentry. It utilises many

Bootstrap CMS 2.5k Dec 27, 2022