Skip to content

kothing/laravel_many_demos

 
 

Repository files navigation

Installation

Clone application using

git clone https://github.com/faridsh69/cms2.git
create .env file, fix APP_URL and DB_DATABASE
cp .env.example .env
cp .env.example .env.testing

Install dependencies

composer install

Produce a key for laravel

php artisan key:generate

Create a link to your storage file from public folder

php artisan storage:link

Run migrations, also it will fully seed fake data

php artisan migrate:fresh --seed

When you changed your models do not create migration file, or factory, just run:

php artisan cms:migration

Admin panel:

http://cms.test/auth/login
username: [email protected]
password: 123456

Run code style

It will check app, config, database, routes and test folders

.\vendor\bin\ecs --fix

Run tests

.\vendor\bin\phpunit

Generate API docs

php artisan scribe:generate

Creating personal token using passport

php artisan passport:install
To get Client ID, and Client Secret use this:
php artisan passport:client --password

Laravel CMS

you can define your model, then migration, routes, controllers, views, policies, test, factory, seeder, table, form, tags, categories, medias, api, export, import, print, sorting, filter ... will be automatically generate by cms

Check App/CMS folder, no more

Also Theme with modules and blocks with settings, logs, backup, code style configuration are implemented.

For more information about the structure of model check models folder

Attribute Use Example values
Name Name of column in database.
Name of field in form.
Used in factory.
title, description, url, content,
full_name, image, language, user_id,
category, phone, address, email, password
Type Type of column in database.
Used in factory.
string, text, boolean,
integer, bigInteger, tinyInteger, unsignedBigInteger,
array, decimal, float, file, date, time, timestamp
Database properties of column in database. nullable, unsigned, unique, default, none
Rule Rules for store and edit data. required, nullable, image, max:190,
min:3, unique, boolean, exists:users,id,
numeric, file|image|mimetypes:image/*
Help Help block in forms. Title should be unique and must not be same with H1.
Form Type Define type of input in form. textarea, ckeditor, entity, checkbox,
enum, color, date, time, switch,
password, email, file, number, none
Table Show field in table or not. true, false
class Blog extends App\Services\BaseModel
{
	public $columns = [
		['name' => 'title'],
		['name' => 'url'],
		['name' => 'description'],
		['name' => 'content'],
		['name' => 'keywords'],
		['name' => 'image'],
		['name' => 'activated'],
		['name' => 'google_index'],
		['name' => 'canonical_url']
	];
}

About

Love Beautiful Code ? I do too!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.5%
  • PHP 26.2%
  • HTML 19.4%
  • CSS 2.9%
  • Blade 1.8%
  • Vue 0.2%