This repository is a copy of the simple PHP/Laravel CMS except the CMS views have been converted from vanilla PHP to Blade.
For these instructions I'm going to us MAMP as my development environment. But you could upload this application to a host, deploy using Docker, or the Laravel built in server.
A few notes For Windows Machines:
-
A Laravel application deploy locall on MAMP seems to have problems running on a Windows computer inside the
OneDrivefolder. Make sure your project folder is outside of yourOneDrivefolder. -
When PHP is downloaded for Windows, the
php.inifile will default to havingfileinfo,zip, andpdo_mysqldisabled. You may need to anable these inside thephp.inifile. This file is likely located atc:/PHP/php.ini. Open this file and make the following changes:Enable the following three lines:
;extension=pdo_mysql ;extension=fileinfo ;extension=zipAnd remove the semi-colon:
extension=pdo_mysql extension=fileinfo extension=zip
To set up this CMS follow these steps:
-
Using your Terminal (or Git Bash on Windows), navigate to your working folder:
$ cd <FOLDER_NAME> $ lsNote: On a Wiindows machine use
dirto view the files in the current folder:$ dir -
Clone this repo:
$ git clone https://github.com/codeadamca/laravel-blade-cms.git -
Using the Terminal, use
lson a Mac otdiron a Windows machine to view the files in the current directory:You should now see a folder named
laravel-blade-cms. Change the present working directory to your new folder:$ cd laravel-blade-cms -
Using the Terminal (or Git Bash), run
composer update:$ composer update -
We need to setup the database connection.
Using MAMP and phpMyAdmin, create a new databse.
Make a copy the
.env.samplefile and name it.env. Update the new.envfile with your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=<DATABASE_NAME> DB_USERNAME=root DB_PASSWORD=root
On a Mac I also need to define the socket. Under
DB_PASSWORDI'm going to add:DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock
Your socket setting may be different. When your MAMP server is up and running, open the MAMP start page (http://:8888/MAMP), go to the MySQL tab, and your socket location will be listed:
The database setup included with this applications includes migrations and seeding. Run the following command to create the required tables and seed them with testing data:
$ php artisan migrate:refresh --seed -
Update your
.envfile to use thepublicfile system:FILESYSTEM_DRIVER=public
And then run this command using the Terminal:
$ php artisan storage:link -
Opne up your MAMP preferences and set the document root to the
publicfolder in yourlaravel-blade-cmsfolder:Restart MAMP.
-
Using a Terminal, create an app key:
php artisan key:generate
To view the public front end go to http://localhost:8888/ on a Mac or http://localhost/ on a Windows machine. This may be different based on your MAMP configuration.
To log in to the admin, use the URL http://localhost:8888/console/login on a Mac or http://localhost/console/login on a Windows machine. This may be different based on your MAMP configuration.
You will need to look up the email addresses in the user table and the default password is "password".
Full tutorial URL:
https://codeadam.ca/learning/php-cms-laravel.html


