cornell-custom-dev/cd-laravel-base

Cornell Custom Dev Laravel starter kit for Livewire.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 2

Language:Blade

Type:project

pkg:composer/cornell-custom-dev/cd-laravel-base

dev-main 2025-12-19 18:31 UTC

This package is auto-updated.

Last update: 2025-12-19 19:43:08 UTC


README

Setup

Run composer setup after cloning to set up your environment.

FluxPro components will not be accessible until you provide Flux repo credentials in auth.json.

Note: If you run composer setup inside the lando container you will need to provide a GitHub Token to access the private https://github.com/CornellCustomDev/cds repository.

Local authentication setup

# File: .env
REMOTE_USER=your_netid_here

This skips SSO authentication, see below for more details on SSO setup.

Run npm

Run the following commands for local environment:

npm install
npm run build
lando artisan optimize

Recreate database with User table data:

Run this command to recreate your database and seed users table:

lando artisan migrate:fresh --seed  

Notes: The migrate:refresh command will roll back all of your migrations and then execute the migrate command. This command effectively re-creates your entire database.

Layout

The Layout is built with the Cornell Design System: https://cornellcustomdev.github.io/cds-docs/

Edit the layout starting at resources/views/components/layouts/app.blade.php

Components

Components are built with FluxPro. Examples of components are at resources/views/examples/form.blade.php

Available components:

Using components

Components are used in blade files with the <x-cds syntax. For example, to use the text input forms component, you would write:

<x-cds.forms.input
    name="email"
    label="Email"
/>

You can also pass additional attributes to the component and they will be applied to the contained input element ("required" in this case). Named slots can also be used to fill attributes. For example:

<x-cds.forms.input name="name" label="Name" required>
    <x-slot:description>
        Please enter your full name.
    </x-slot:description>
</x-cds.forms.input>

Common and defaulted attributes can be found in the component's blade file, generally as @prop definitions so that an IDE can provide autocomplete.

The underlying Flux component documentation is linked from the blade file and should be consulted for additional options and usage.

SSO Authentication

The starter kit can use Cornell's SSO for authentication. routes/examples.php demonstrates how to use CUAuth to require SSO login for specific pages.

The defaults set in config/cu-auth.php use Apache mod_shib and will create a new user if one does not exist. See the config file for other options which can also be set with environment variables.

Most apps will require a custom implementation of the CUAuthenticated event listener to handle user authorization. See app/Listeners/CUAuthorizeUser.php for an example of how to implement this listener.

Local setup

Recommended

CU_AUTH_IDENTIY_MANAGER=php-saml

This will allow you to test SSO authentication locally using the OneLogin SAML PHP Toolkit.

Alternatively, you can skip authentication locally:

REMOTE_USER=your_netid_here