# Northwestern Bootstrap Preset for Laravel

Adds a Northwestern Bootstrap theme into your Laravel application.

The Sentry browser SDK (for reporting on JS errors) will be automatically configured if you are using Sentry in the Laravel app.

# Overview

The package modifies the default Bootstrap settings to be more purple, loads the Northwestern fonts, adds Font Awesome icons, and gives you a responsive ready-made site layout.

Purple container layout

For the most part, the purple-ization is rolled out across all Bootstrap components and you will not need to do anything special to take advantage of it.

In order to use this package, you must:

  • Be on Laravel 7+
  • Use Yarn to manage your JS/CSS dependencies
  • Use Laravel Mix to bundle your assets

# Installation

Install the package via composer, and then swap to the Northwestern preset. This works like the standard Laravel UI presets.

Overwrites Files

Changing your UI preset will overwrite some files in resources/scss, resources/views, and resources/js.

If you are adding this to an existing app, make sure you have a backup of your project before changing the preset.

The installation process is:

composer require northwestern-sysdev/northwestern-laravel-ui
php artisan vendor:publish --provider="Northwestern\SysDev\UI\Providers\NorthwesternUiServiceProvider"

php artisan ui northwestern # you can add --auth if you need the register/login stuff

You should review the config/northwestern-theme.php config file and adjust the default values. Alternatively, you may set them all as environment variables:

# Lockup image used in the header
# Should be either a full URL (http://...) or a file in your public folder (images/lockup.png)
NU_THEME_LOCKUP=https://common.northwestern.edu/v8/css/images/northwestern.svg

# Office & contact info used in the footer
NU_THEME_OFFICE_NAME=Information Technology
NU_THEME_OFFICE_ADDR=1800 Sherman Ave
NU_THEME_OFFICE_CITY=Evanston, IL 60201
NU_THEME_OFFICE_PHONE=(777) 777-777
NU_THEME_OFFICE_EMAIL=foo@example.org

# If you are using Sentry, specifying the DSN with the same environment variable
# will initialize the browser SDK to capture client-side JS errors.
#
# This is NOT required and can be ignored if you do not use Sentry.
SENTRY_LARAVEL_DSN=

The resources/views/layout/_nav.blade.php view will be created in your project. This is intended for you to customize with nav items, login links, and user info.

# Verifying the Installation

The package has a built-in demo view to showcase the layout & theme. The easiest way to see it is to add an entry to your routes/web.php file:

Route::get('/demo', function () {
    return view('northwestern::demo-styles');
});
Last Updated: 4/8/2020, 11:21:31 PM