Skip to content

Getting started as a developer

Tate Bosler edited this page Feb 22, 2019 · 2 revisions

Want to help out with the project? Curious about where you need to start modifying code? Here's a rundown on how to find the lines that get hit.

The routes file

Assuming you've gotten everything installed correctly, you can run php artisan route:list on the command line. This will print the master route list into your terminal (standard output) - it's a tall and wide table, so a wide terminal is extremely helpful.

Routes are organized alphabetically by their URI and will contain the following columns:

  • Domain: For all Mission Control routes, this is left blank.
  • Method: HTTP verbs accepted on this route, such as GET and PATCH. If you're viewing a web page of Mission Control in a browser, look for its URI with a GET method.
  • URI: The actual URI of the route. "Placeholder" parameters that can accept any value are listed in curly braces (and these usually represent IDs of things that will be used in the controllers later).
  • Name: A static name that can be used in URL generation helpers, such as route().
  • Action: The controller class and method that will be executed.
  • Middleware: Checks that are run before the action. These are usually related to security, authentication, or permission checks.

Once you have located the route you wish to modify, you can go to the controller.

The controllers

All controllers are located in app/Http/Controllers. Controllers generally group together actions that target a common resource (for example, ShowController handles all radio show application related routes). Class names are set to match file names.

Many functions receive an Illuminate\Http\Request object. This object contains information about the authenticated user (if the route requires it), as well as any incoming form data.

Public functions outside of the API will usually return either view() or redirect(). If a function returns view(), that passes control to the UI rendering engine, Blade. On the other hand, a redirect() function call will send the user to a different location, causing a different route to be requested. Redirections are most common after a form submission. Public functions within the API typically return an array or Laravel Collection, which will be automatically converted to JSON when needed.

UI

The UI is rendered by calls to view(). The first parameter is the path of the Blade template file to be rendered, which can be found in the resources/views directory. Note that the name in the view() call marks subdirectories with dots, so shows/index.blade.php is rendered by calling view('shows.index').

Standard HTML components will be rendered as-is. Non-standard elements are Vue components, which are defined individually in resources/assets/js/components and loaded with resources/assets/js/app.js (except some schedule builder components, which are handled separately).

Making changes to Vue components requires an asset re-compilation, done with npm run dev on the command line.

jQuery

jQuery code is handled with page-specific scripts in resources/assets/js/pages. These scripts will be automatically copied to public/js/pages when running asset compilations, but you'll need to load them individually with <script defer src="/js/pages/..."></script> in the Blade templates that require them.

Clone this wiki locally