Git Product home page Git Product logo

laravel-skeleton's Introduction

Blue Chip Laravel Skeleton Project

Laravel 5.2 Skeleton

Installation

composer install && npm install && bower install
gulp watch

Folder structure

The folder structure of the skeleton app is as follows, with some important folders highlighted. You should not need to touch any folder other than the ones explained below.

|-- app
    |-- Http
        |-- Controllers
        |-- Middleware
        |-- Requests
        |-- routes.php
|-- bootstrap
|-- config
|-- database
|-- public
|-- resources
    |-- font
    |-- img
    |-- js
        |-- critical
        |-- main
    |-- lang
    |-- scss
        |-- critical
        |-- main
    |-- views
|-- storage
|-- tests

bootstrap, config, database, public, storage, tests

Do not modify anything in these folders unless you know what you are doing. Do not put anything in public folder, it will get deleted when pushing live. Images and other assets should go into resources folder.

app

You won't have to touch anything in this folder except defining new routes in app/Http/routes.php and controller actions in app/Http/Controllers/*.php. Anything else leave as is.

Resources

This is the folder you will be working off of the most. It contains all the assets as well as css, js and view files.

Images

All the images go into the resources/img folder. All the images will be compressed and put in the respective folder in public/assets. To access the file from the resources folder in Twig template use

<img src="{{ resource('img/logo.png') }}" alt="Logo image">
CSS

CSS is split into two sections, main and critical. You can use Neat/Burbon mixins as they are pulled in automatically.

Main CSS section has all the main CSS definitions and declarations. You can split the CSS into sections and join them into one file in style.scss located at resources/scss/main.

In the critical section you should only put minimal amount of CSS to have the above-the-fold content display better before main CSS kicks in. Rule of thumb is that critical CSS should not exceed one screen of definitions. Critical CSS is inlined on every page.

Javascript

Similar to CSS Javascript is split into two sections, critical and main. Both files are located in resources/scss. Critical JS will be inlined on every page.

Views

All views are done in Twig and located at resources/views. layout.twig controls the structure and index.twig has the site content.

Routes

To define a new route to /privacy-policy enter the followingroutes.php file located in app/Http folder

Route::get('/privacy-policy', 'HomeController@privacy');

Now define a new action in HomeController located in app/Http/Controllers and add the following

public function privacy()
{
    return view('privacy');
}

The view rendered is taken from resources/views/privacy.twig.

laravel-skeleton's People

Contributors

taylorotwell avatar daylerees avatar franzliedke avatar jasonlewis avatar sparksp avatar cviebrock avatar tobsn avatar crynobone avatar grahamcampbell avatar bencorlett avatar jeffreyway avatar ericlbarnes avatar neoascetic avatar jesseobrien avatar codler avatar jakobud avatar mikelbring avatar kapv89 avatar kbanman avatar vespakoen avatar mathewhany avatar pedroborges avatar lancepioch avatar hirokws avatar barryvdh avatar tommyc81 avatar bpierre avatar loic-sharma avatar bertiful avatar mcintyre94 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.