Skip to content

The starter template for all CMV Laravel + Vue.js applications

Notifications You must be signed in to change notification settings

mayvenstudios/laravel-vue-starter-template

Repository files navigation

Laravel Vue Starter

Setting up

  • set up a virtual host. You can either do it using homestead built-in tools or by hand. Make sure to edit your /etc/hosts file.
  • Example nginx.conf:
server {
    listen 80;
    server_name lv-starter.dev;
    root "/www/laravel-vue-starter-template/public";

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/lv-starter.local-error.log error;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }
}
  • cd to the root of the project
  • run composer install
  • run npm install
  • copy .env.example to .env
  • create a new mysql database to use in the app. By default it's called boilerplate
  • run php artisan migrate --seed
  • at this point you should be able to open the app in your browser
  • run gulp; gulp watch and start coding

What's inside

  • bugsnag integrationhttps://github.com/bugsnag/bugsnag-laravel. To enable it add a BUGNSAG_API_KEY variable in .env and uncomment /config/app.php:164
  • slack integration. To enable it create a webhook and set a SLACK_ENDPOINT variable in .env
  • email integration - the configuration is pretty straightforward. Check out EMAIL_* variables in .env
  • basic custom middlewares - mastermind & customer
  • 2 users - mastermind@app.dev/password & user@app.dev/password
  • php
    • register/login/restore password functionality
    • App\Jobs\SendEmail job - emails should be sent using this
    • App\Jobs\SendSlackMessage job - for sending slack messages
    • rest api routes. There're several helper methods to return json data - return $this->respondWith*()
    • handy helpers - /app/misc/helpers/*. Be sure to check them out
  • javascript
    • pjax links. To make a pjax link just add a [data-pjax] attribute to it. Once clicked it will replace contents of #pjax-container with dynamically loaded html
    • vue.js app structure . To code a new page just add a [data-controller=controller/name] attribute to the parent div & include it in /resources/js/vue/controllers.js. There's an example controller that handles the profile page (when logged in - /settings).
    • /resources/js/misc/notify.js - helper library to show notifications and confirmation popups

About

The starter template for all CMV Laravel + Vue.js applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published