Skip to content

TolotraRam/laravel-angular-cms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Angular CMS Starter Site

Join the chat at https://gitter.im/devmark/laravel-angular-cms

screenshot

Features:

  • Independent Laravel, Angular
  • Laravel 5.1 for API
    • Include Json Auth Token
    • Include Data Transformer
    • Include API Data Exception
    • Output JSON or others
    • Include CSRF Protection
    • Timezone
  • Angular 1.4 for Backend
    • Include AdminLTE template
    • Include ui-router, Restangular etc ...
    • Timezone
    • Support Multi-Languages interface
  • Backend
    • User & Role management
    • Manage Media & Media Categories
    • Manage posts and posts categories
  • Frontend
    • Soon

Install:


Step 1: Get the code

https://github.com/devmark/laravel-angular-cms/archive/master.zip


Step 2: Init api

Init Laravel

  1. Move to api directory
  2. Run composer install

Init Database

  1. Setup database config in .env file (copy from .env.example)
  2. Run php artisan migrate --seed

Step 3: Init Backend

This project makes use of Bower. You must first ensure that Node.js (included in homestead) is installed on your machine.

  1. Install npm, gulp, bower
  2. Run sudo npm install
  3. Run bower install
  4. Edit backend/src/index.js, replace cms.dev to your api domain
  5. Run gulp serve for development

Step 4: Production

API

  1. edit .env file set APP_DEBUG to false

Backend

  1. run gulp in backend directory. It will auto copy backend/dist all files to api/public/assets-backend

Frontend

  1. Move all frontend files to api/public

Server

Redirect backend:

Nginx
    location ~ ^/backend {
        rewrite ^/backend(.*) /assets-backend/$1 break;
    }
Apache
    RewriteRule ^backend/(.*)\.([^\.]+)$ /assets-backend/$1.$2 [L]

Step 5: Start

  1. access http://yourdomain.com/backend You can now login to admin:

    username: admin@emcoo.com password: adminmark


Demo:

Soon


Screenshot:

screenshot screenshot screenshot


API Detail:

Soon

Add Exception

Add Whatever Exception you want in api/app/Exceptions

Example:

class EmailOrPasswordIncorrectException extends HttpException
{
    public function __construct($message = null, \Exception $previous = null, $code = 0)
    {
        parent::__construct(401, 'Email/Password is incorrect', $previous, [], 10001);
    }
}

Use it:

    throw new EmailOrPasswordIncorrectException;

Output:

{
    "result":{
        "status":false,
        "code":10001,
        "message":"Email\/Password is incorrect"
    }
}

Add Transformer

Soon

Config JWT

Soon

Backend Detail:

Soon

Frontend Detail:

  1. You can move all frontend file to api/public

About

laravel api with angular backend cms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 36.2%
  • JavaScript 24.7%
  • CSS 20.9%
  • HTML 18.0%
  • ApacheConf 0.2%