12/19/2016 - 4:35 PM

The process of setting up a new Laravel-Angular-Bootstrap project

The process of setting up a new Laravel-Angular-Bootstrap project

New Laravel-Angular-Bootstrap project (lar-ang-boot)

1. Create Project
  make sure composer is installed
  'composer global require "laravel/installer"'
  add '$HOME/.composer/vendor/bin' to $PATH
  in /var/www/html run 'laravel new {projectname}'

2. Set permissions
  'chmod -R 777 storage'
  'chmod -R 777 bootstrap/cache'

3. Add authentication
  'php artisan make:auth'
  'php artisan migrate'
  'php artisan app:name [appname]'
  delete from views home.blade.php
  change css path in /views/layouts/app.blade.php to ‘{{ url(‘/’) }}/styles/main.min.css’
  delete js path in /views/layouts/app.blade.php (not needed for authentication)
  change $redirectTo in /app/http/controllers/auth/LoginController.php to the intended landing page route
  override logout method in /app/http/controllers/auth/LoginController.php
    copy logout method from /vendor/laravel/framework/src/illuminate/foundation/auth/AuthenticatesUsers.php without the redirect line

4. Prepare assets
  move views to public/ and register the move in config/view.php
  create index.php in public-src/
  register index.php file as view in HomeController: ('index')
  add dynamic app files (e.g. views/*, styles/main.scss, js/app.js, js/controllers/*, etc.) to public-src/
  register assets in index.php
  	CSS:  <link rel="stylesheet" href=“{freshest bootstrap’s location}”>
  	js: <script src=“{boostrap-without-jquery’s location}”></script>

5. Add task management
  make sure npm, grunt and grunt-cli are installed globally
  npm install --save-dev -- bootstrap time-grunt angular angular-route bootstrap-sass grunt grunt-contrib-clean grunt-contrib-concat grunt-contrib-copy grunt-contrib-cssmin grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-jscs grunt-sass grunt-usemin jit-grunt jshint jshint-stylish
  inside /node_modules run git clone https://github.com/tagawa/bootstrap-without-jquery.git
  add references to static app files (e.g. /node_modules/bootstrap/bootstrap.min.css, /node_modules/angular/angular.min.js, etc.) in index.php
  copy Gruntfile.js to project folder and make sure all assets are in place

6. Add appropriate urls:
  add to apache2.conf: 'Alias /{projectname} /var/www/html/path/to/laravel/public'
  add to /public/.htaccess (after RewriteEngine On): RewriteBase /{projectname}
  make sure base url in index.php is set to '/{projectname}/' to avoid redirection

(run composer install & npm install)