Skip to content
Dave Stewart edited this page Apr 18, 2017 · 10 revisions

The setup page will load automatically the first time you try to use Sketchpad.

sketchpad-install

Paths

Sketchpad needs to know the location of 3 types of resources to be able to work:

  • controllers/ to store and run your code
  • views/ to display custom HTML layouts
  • assets/ to customise the UI or run custom JavaScript

These folders can be installed outside of your main application, or you can use your existing folders, depending on the setup you want to run.

To make the decision easier, Sketchpad offers a choice of 4 editable presets:

Separate

Sketchpad functions separately from your app; great for development

+- yourapp.dev
    +- app
    +- ...
    +- sketchpad
    |   +- assets
    |   +- controllers
    |   +- views
    +- ...

This is the recommended setup if you just want a bolt-on development environment, because it keeps everything in a single subfolder, outside of your app, separating concerns and making it easier to version control.

Integrated

Integrates Sketchpad into your app; code lives inside Laravel subfolders

+- yourapp.dev
    +- app
    |   +- Http
    |   |   +- Controllers
    |   |       +- Sketchpad
    |   +- ...
    +- resources
    |   +- views
    |   |   +- sketchpad
    |   +- ...
    +- public
    |   +- vendor
    |   |   +- sketchpad
    |   +- ...
    +- ...

Application

Sketchpad becomes your app; useful if you want a quick front-end UI

+- yourapp.dev
    +- app
    |   +- Http
    |   |   +- Controllers
    |   +- ...
    +- resources
    |   +- views
    |   +- ...
    +- public
    |   +- assets
    |   +- ...
    +- ...

Custom

Full control over the installation; choose your own folders, paths, routes, etc.

+- yourapp.dev
    +- app
    +- custom?
    |   +- src?
    |   |   +- Controllers?
    |   +- resources?
    |       +- assets?
    |       +- views?
    +- ...

Autoloader

If you choose to install your controllers folder outside of your existing app/ folder, Composer will need to know so it can load the classes.

This is fairly simple; if you choose a base directory of sketchpad and a namespace prefix of Sketchpad, the PSR-4 mapping will be saved as so:

"psr-4": {
    "Sketchpad\\": "sketchpad/"
}

If you choose to install Sketchpad within your existing application, there'll be no change to your composer.json.

Clone this wiki locally