Amila Laravel CMS - Free, open-source Simple Bootstrap Laravel CMS

Last update: Jun 7, 2022

Amila Laravel CMS

image Laravel CMS image Latest Stable Version

  • Free, open-source Simple Bootstrap Laravel CMS, support Laravel 8.x or 7.x or old Laravel 6.x & 5.x, support MySql & MariaDB & PostgreSQL
  • Can integrate with any existing Laravel project, install as an individual Laravel package
  • Only add a few database tables with a prefix, not effect your existing database tables.
  • You can easily custom the database table names, the page URL path(route) and the template(theme)
  • Build-in Website is ready after install. Easy to use, simple enough but flexible.
  • Basic Laravel 8.x/ Laravel 7.x /Laravel 6.x / Laravel 5.x syntax and blade template, no need to learn a "new language"

How to install for an existing Laravel project

  • Support Laravel 8.x & Laravel 7.x & Laravel 6.x & Laravel 5.x
// Make sure you already have laravel installed and configured the database in the .env
// Go to your laravel project folder and install it via composer
// Initialize the CMS (You can set up database table prefix and locale here)

composer require alexstack/laravel-cms && php artisan laravelcms


// Now you can access the cms frontend site: http://yourdomain/cms-home

// Access the backend with the FIRST USER of your site: http://yourdomain/cmsadmin

// Note: The default admin is the first user in your laravel database(user id = 1 )

How to set up a brand new CMS website with the latest Laravel

  • It's good for a local testing, it's support the latest Laravel version
// Step 1: Install Laravel to folder cms
composer create-project laravel/laravel cms && cd cms && composer require alexstack/laravel-cms

// Step 2: install CMS in silent mode
php artisan laravelcms --locale=en --table_prefix=cms_ --silent=yes

// Note: it will ask for database settings if you did not change the default .env file
// Note: it will automatically run a web server on port 9321 for your project

// Step 3: Now, you can access your cms backend via http://127.0.0.1:9321/cmsadmin/
// Default admin username: [email protected]  password: admin321

How to uninstall

// Uninstall the CMS
php artisan laravelcms --action=uninstall

Demo & Documents

Screenshot of the output of install command

image

Screenshot of the output of uninstalling command

image

Screenshot of the admin panel

image image image

Set locale language to cn instead of en

cn_image

Error "Route [login] not defined" while access the backend /cmsadmin/

  • This means you did not install Laravel Auth(User system)
  • Can be fixed by the below commands:
// Laravel 6.x & Laravel >= 7 & Laravel >= 8
composer require laravel/ui && php artisan ui vue --auth
// Laravel 5.x, run blow command instead
php artisan make:auth && php artisan migrate
  • After install the Auth package, please register the first user as the admin

How to log into the backend /cmsadmin/?

  • Amila CMS use your existing Laravel user system
  • You need to log in with the FIRST USER of your site (user_id = 1)
  • You can add more admin users by change the admin_ary in config/laravel-cms.php
  • If you don't have any existing user, then register a new one via http://your-domain/register

Why the uploaded image can not display (404 error)

  • You can fix it by creating a storage public link
  • php artisan storage:link
  • eg. The public/storage should link to ../storage/app/public, if the public/storage is a real folder, you should remove/rename it and run "php artisan storage:link" to set up the link.

Custom the cms route in config/laravel-cms.php

  • homepage_route: This is the frontend homepage. By default it is /cms-home, you can change it to / then remove the existing / route in the routes/web.php
# Change homepage_route to /  in config/laravel-cms.php
'homepage_route'    => env('LARAVEL_CMS_HOMEPAGE_ROUTE', '/'),

# Remove the existing / route in the routes/web.php

// Route::get('/', function () {
//     return view('welcome');
// });
  • page_route_prefix: This is the frontend page prefix. By default it is /cms-, it will match path like /cms-*. You can change it to a folder like /xxx/ or anything like xxx-, eg. Page- Article-
'page_route_prefix' => env('LARAVEL_CMS_PAGE_PREFIX', '/Article-'),
  • admin_route: This is the backend admin page route, By default, it is /cmsadmin
'admin_route'       => env('LARAVEL_CMS_BACKEND_ROUTE', '/admin2019'),
  • After changing the route, you will need to run below commands:
php artisan laravelcms --action=clear

Display an image with different size in the frontend Laravel .blade.php template file

  • .blade.php Code examples:
imageUrl($file_data->main_image, '1000') }}" class="img-fluid" />                 @endif ">
@if ( isset($file_data->main_image) )
    "{{$helper->imageUrl($file_data->main_image, '1000') }}" class="img-fluid" />

    "{{$helper->imageUrl($file_data->main_image, '500') }}" class="img-fluid" />

    "{{$helper->imageUrl($file_data->main_image, 'w', '150') }}" class="img-fluid" />

    "{{$helper->imageUrl($file_data->main_image, '100', '100') }}" class="img-fluid" />

    "{{$helper->imageUrl($file_data->main_image, 'original', 'original') }}" class="img-fluid" />

@endif
  • You can get an image with any width and height. or use the original image.
  • Available image variables: $file_data->main_image, $file_data->main_banner, $file_data->extra_image, $file_data->extra_image_2
  • The CMS will resize the image at the first time, then will directly use it afterwards.

How to change the CSS & JS assets of the frontend?

  • The asset files located at public/laravel-cms/, eg. public/laravel-cms/frontend/css
  • Example code to load css or js:
... ">
"stylesheet" href="{{ $helper->assetUrl('css/main.css') }}">
...
  • The default template file will load CSS and js asset with last_modify_time parameter to avoid cache from the browser

How to set up a different template theme from the default?

  • Copy the default theme folder /resources/views/laravel-cms/frontend to /resources/views/laravel-cms/new_theme
  • Change the frontend_dir in the settings page to new_theme
  • Default value in config/laravel-cms.php
    'template' => [
        'frontend_dir'      => 'frontend',
        'backend_dir'       => 'backend',
        'backend_language'  => 'en',
        'frontend_language' => 'en',
    ]
  • run php artisan config:cache to load new config file
  • Change template settings for the pages in the backend
  • The css/js asset files will locate at public/laravel-cms/new_theme

Set default slug format and suffix for page SEO URL in config/laravel-cms.php

  • You can change it in the settings page
  • 'slug_format' can be from_title, id, pinyin
  • 'slug_suffix' can be anything you want, empty means no suffix
    'slug_format'   => 'from_title',
    'slug_suffix'   => '.html',
    'slug_separate' => '-',

Use your own PHP class / How to integrate your PHP code into the CMS

  • One simple option is to implement a method from your own PHP controller/class by adding it into a cms page. Tutorial for it.
  • Another option is to create a CMS plugin for your own project and use it for all pages. A tutorial is here. You can also publish the plugin if the feature can be used by other websites.

How to upgrade the CMS?

  • Run below command in your Laravel project folder
  • It will ask whether you want to copy the new view, asset and language files to your project
composer require alexstack/laravel-cms && php artisan laravelcms --action=upgrade
  • Upgrade screenshot

image

ReactJS for backend All Pages list

  • Laravel CMS use ReactJS for backend All Pages list, the ReactJS source code can be found here
  • The compiled js file is here: /public/laravel-cms/backend/js/reactLaravelCmsBackend.js
  • It can be switch to normal Laravel blade page by change the "react_js": true to false in the setting system.all_pages

What PHP versions do you support?

  • Amila Laravel CMS passed the basic test on PHP 7.1, 7.2, 7.3, 7.4

Laravel versions support

  • cms version >= 1.4.4, support all laravel version >= 6.0
  • cms version <= 1.4.3: support Laravel 5.x, 6.x, 7.x, 8.x
  • Please install version 1.4.3 if the laravel version is 5.x of an existing project

How to use PostgreSQL instead of MySql or MariaDB?

  • Make sure the .env changed before run the install command line. An example:
DB_CONNECTION=pgsql
DB_HOST=topsy.db.elephantsql.com
DB_PORT=5432
DB_DATABASE=oktetra
DB_USERNAME=oktetra
DB_PASSWORD=the-postgresql-password

How to store & access files on AWS s3?

  • On AWS: Create a s3 bucket and enable it as a Static website hosting, allow all public access and set s3:GetObject Bucket policy, Create an IAM user for api use.

  • Laravel .env file, set below variables:

    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
    AWS_DEFAULT_REGION=
    AWS_BUCKET=
    FILESYSTEM_DRIVER=s3
    AWS_URL=
  • composer require league/flysystem-aws-s3-v3 ^1.0

  • done

How to install laravel/jetstream or other ui instead of laravel/ui?

// Step 1: Install Laravel to folder cms
composer create-project laravel/laravel cmsjet && cd cmsjet && composer require laravel/jetstream

// Step 2: install jetstream
php artisan jetstream:install inertia && npm install && npm run dev

// Step 3: install CMS in silent mode
composer require alexstack/laravel-cms && php artisan laravelcms --locale=en --table_prefix=jet_ --silent=yes

// Step 4: Edit routes/web.php
- Remove or comment Auth::routes();
- Change Route::get('/' to Route::get('/welcome'
- Run command: php artisan laravelcms --action=clear

// Step 5: Now, you can access your cms backend via http://127.0.0.1:9321/cmsadmin/
// Default admin username: [email protected]  password: admin321

How to install it on HeroKu?

  • Local: First, install at your localhost and make sure everything works fine
  • Local: Create a github repository for the laravelcms folder. eg. cd cms && git init && git remote add origin https://github.com/xxx.git
  • Local: Enable gd exif for heroku php: composer require ext-exif ext-gd
  • On HeroKu: create a new app from this github repository, enable automatically deploy
  • Local: to use Nginx/apache together with PHP, add a file named Procfile on folder cms with content below:
    web: vendor/bin/heroku-php-apache2 public/
  • HeroKu: add Dyno formation: web vendor/bin/heroku-php-apache2 public/
  • HeroKu: add .env variables to settings -> Config Vars
  • Done

License

  • The Amila Laravel CMS is open-source software licensed under the MIT license.

GitHub

https://github.com/alexstack/laravel-cms
You might also like...

Simple Bootstrap Laravel CMS. Support Laravel 8.x Can integrate into any existing Laravel project.

Simple Bootstrap Laravel CMS. Support Laravel 8.x Can integrate into any existing Laravel project.

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

Jun 7, 2022

Borgert is a CMS Open Source created with Laravel Framework 5.6

Borgert is a CMS Open Source created with Laravel Framework 5.6

A simple CMS to start projects in Laravel containing some modules. Blog, Pages, Products, Mailbox, Image Gallery, Log Viewer and Users. Frontend: Blog

Jun 9, 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

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

Jun 27, 2022

BlizzCMS an Open-Source CMS

BlizzCMS Plus BlizzCMS Plus is a restructured and improved version of BlizzCMS v1. The development of this version is made constantly by the developer

Jun 10, 2022

Contao Open Source CMS

About Contao is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the project website fo

Jun 23, 2022

Bolt CMS is an open source, adaptable platform for building and running modern websites.

Bolt CMS is an open source, adaptable platform for building and running modern websites. Built on PHP, Symfony and more. Read the site for more info.

Jun 30, 2022

Open Source Portfolio/Resume CMS

Open Source Portfolio/Resume CMS

Ezfolio Open Source Portfolio CMS Ezfolio is a professional open source portfolio CMS built using Laravel, React and Ant Design. Choose from awesome t

Jun 26, 2022

Fork is an easy to use open source CMS using Symfony Components.

Fork is an easy to use open source CMS using Symfony Components.

Installation Make sure you have composer installed. Run composer create-project forkcms/forkcms . in your document root. Browse to your website Follow

Jun 17, 2022

🚀Bolt CMS is an open source, adaptable platform for building and running modern websites

🚀Bolt CMS is an open source, adaptable platform for building and running modern websites

Jun 13, 2022
Comments
  • 1. Version 1.4

    1. Use your own PHP controller/class by adding it into a CMS page. Details: https://www.laravelcms.tech/Laravel-Advanced-Override-the-page-content-by-your-PHP-Class-method-function.html
    2. The All Pages in the backend will use ReactJS by default. Details: https://www.laravelcms.tech/Laravel-Backend-All-Pages-search-and-display-settings.html
    3. Frontend search improve: Allow search keyword & tag together
    4. Frontend inquiry form improve: Show inquiry form even no record in the database
    Reviewed by AlexStack at 2020-01-12 20:12
  • 2. Allow install plugins at the CMS backend other than install via composer

    1. Allow saving the remote image to local via uploadFile()
    2. Allow install page type plugin at the CMS backend other than install via composer
    3. Move all bak files to the storage backups folder
    4. Design standalone plugin
    5. Test 3 plugins
    Reviewed by AlexStack at 2019-10-08 04:27
  • 3. Create SECURITY.md

    Hey there!

    I belong to an open source security research community, and a member (@nightfury99) has found an issue, but doesn’t know the best way to disclose it.

    If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

    Thank you for your consideration, and I look forward to hearing from you!

    (cc @huntr-helper)

    Reviewed by JamieSlome at 2022-04-28 06:57
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.

Jun 23, 2022
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

Jun 13, 2022
Jun 18, 2022
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

Feb 2, 2022
Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.

Question2Answer (Q2A) is a popular free open source Q&A platform for PHP/MySQL, used by over 22,000 sites in 40 languages.

Jun 25, 2022
phpReel is a free, MIT open-source subscription-based video streaming service that lets you create your platform for distributing video content in the form of movies or series.

phpReel is a free, MIT open-source subscription-based video streaming service that lets you create your platform for distributing video content in the form of movies or series.

Jun 11, 2022
ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.
ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.

ExpressionEngine CMS ExpressionEngine is a mature, flexible, secure, free open-source content management system. It is beloved by designers for giving

Jun 24, 2022
Scriptlog is a free and an open source PHP blog software.

Scriptlog is a free and an open source PHP blog software. We're refactoring our legacy weblog code. Making it more simple, secure, modular, fast and robust personal blogging system. Scriptlog runs on PHP 5.6 or higher and uses MySQL.

Dec 30, 2021
ExpressionEngine is a mature, flexible, secure, free open-source content management system.

ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.

Mar 29, 2022
Bootstrap CMS - PHP CMS powered by Laravel 5 and Sentry
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

Jun 17, 2022