All Projects → devmark → laravel-angular-cms

devmark / laravel-angular-cms

Licence: MIT license
laravel api with angular backend cms

Programming Languages

PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
ApacheConf
554 projects

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

Download Now


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: [email protected] password: adminmark


Demo:

Soon


Screenshot:

screenshot screenshot screenshot


API Detail:

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

It helps to output good format you need. Add new transformer you want in api/app/Transformers More details: see this

class UserTransformer extends TransformerAbstract
{

   public function transform(User $item)
    {
        return [
            'id'            => (int)$item->id,
            'email'         => $item->email,
            'lastname'      => $item->lastname,
            'firstname'     => $item->firstname,
            'phone'         => $item->phone,
            'active'        => (boolean)$item->active,
            'created_at'    => $item->created_at,
            'updated_at'    => $item->updated_at,
        ];
    }
}

Config JWT

Soon

Backend Detail:

Soon

Frontend Detail:

  1. You can move all frontend file to api/public
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].