shabaz-ejaz/laravel-cms

A Laravel 5 CMS with CRUD scaffolding and API.

dev-master 2018-10-10 16:37 UTC

This package is not auto-updated.

Last update: 2021-04-14 08:24:19 UTC


README

alt text

Laravel Grafite

This is a pre-packaged Laravel 5.6.* project which uses Grafite CMS

What does this project include?

Requirements

  • Node 4.* or better
  • PHP 7.1.3 or better

Installation

Start by installing dependencies:

composer install
npm install

Publish the assets:

php artisan vendor:publish

Generate an app key:

php artisan key:generate

Create a symbolic link from the public disk directory (this is required for images stored in public):

php artisan storage:link

Database

Configure a database: Open the .env file in the root of the project and configure a database connection. If the .env file does not exist then clone the .env.example file and rename it to .env.

Run migrations:

php artisan migrate

Seed the database:

php artisan db:seed

Set up Laravel Passport for api authentication:

php artisan passport:install

There should be a default admin account for you with the following credentials:

Running

Once dependencies are installed, run with:

php artisan serve

This will open up a Laravel development server at localhost:8000

If you want to open multiple Laravel dev servers you can specify the port like this:

php artisan serve --port=6060

Admin Access

Login to Admin Panel by visiting: localhost:8000/login or if you've got a vhost set up then www.yoursite.com/login

CRUD Builder

To use the CRUD builder you need to run the following command:

php artisan crudmaker:new Post --api --ui=bootstrap --migration --schema="id:increments,name:string,author:string" --relationships="belongsToMany|\App\Models\Tag|tags"

You can use the following options for the above command:

php artisan crudmaker:new ModelName
{--api} # if you want to generate REST api routes, controllers and middleware
{--ui=bootstrap|semantic} # css style
{--serviceOnly} # if you only want service classes generated
{--withFacade} # fuck knows
{--withoutViews}  # don't generate view files
{--migration} # generate a migration script
{--schema} # specify the schema data i.e. db columns
{--relationships} # generate relationships

You can view the full documentation for this here

Using GraphQL

Use this article as a guide for setting up and using GraphQL as an API service

Cache

Laravel configuration and app settings are cached in memory by default. You would near to clear the cache if you have made changes to the config files, expecially the .env file. To clear the cache you can run the following commands:

Clear config cache: php artisan config:clear

Clear general cache: php artisan cache:clear

Clear config cache and generate new cache file: php artisan config:cache

If you are using php artisan serve to run your application then you'll need to restart it if you've made changes in any of the cached config files.

Running Tests

Run all tests:

.\vendor\bin\phpunit

Run all tests from one class

.\vendor\bin\phpunit --filter MyTestClass

Run single test method

.\vendor\bin\phpunit tests/Feature/{testfilename} 

.\vendor\bin\phpunit tests/Unit/{testfilename} 

Laravel Architecture

Scheme

Contribution guidelines

  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact