blsc-guide maintained by tru-laravel-club
BLSC contributor guide
This package is a step-by-step guide for club members who build the BIG Little Science Centre website. It shows every planned feature, what each feature needs first, and the steps to build it. The guide checks the app code, so the steps tick off as you work.
The guide is a development tool only. The BLSC website never depends on it.
Install
-
Clone
blsc-websiteand set it up. Read its README. -
In the
blsc-websitefolder, install the guide as a dev dependency:composer require --dev tru-laravel-club/blsc-guide -
Start the app with
composer dev.
The guide loads only when APP_ENV=local. Servers install with composer install --no-dev, so the guide is never on a server.
Build a feature
-
Open
/guideor runphp artisan guide. Find a feature with the status Ready. Start with Level 1. -
Claim the GitHub issue for the feature, so nobody else builds it.
-
Start the feature:
php artisan guide:start big-little-scientistsThis copies the acceptance test of the feature into
tests/Feature. The test fails at first. You are done when it passes. Do not change what the test checks. -
Do each step. Run each command yourself and read the files it creates.
-
Run the acceptance test:
php artisan guide:verify big-little-scientists -
Run
composer ci:check, then open a pull request.
Statuses
| Status | Meaning |
|---|---|
| Done | Every step passes its check. |
| In progress | Some steps pass. |
| Ready | Every feature it needs is done. Pick it up. |
| Blocked | A feature it needs is not done. The guide names it. |
| Not planned | A lead has not written the steps yet. |
The guide reads the code on your machine. Run git pull to see work that other members merged.
Work on the guide
-
Clone this repository next to
blsc-website. -
Run the checks:
composer install composer ci:checkThis runs Pint, PHPStan and the test suite. CI runs the same checks on PHP 8.3, 8.4 and 8.5.
-
To try your change in the app, use a path repository in
blsc-website:composer config repositories.blsc-guide path ../blsc-guide composer require --dev tru-laravel-club/blsc-guide:@devDo not commit these
composer.jsonchanges.
For leads: plan a feature
Each feature is one PHP file in features/. The file returns a Feature:
return Feature::make('saturday-programs')
->title('Saturday programming page')
->section(Section::Pages)
->level(1)
->needs(['layout'])
->summary('Special Saturday events. Drop-in and free with admission.')
->teaches(['Models', 'Migrations', 'Query scopes'])
->test('SaturdayProgramsTest.php')
->steps([
Step::make('Create the SaturdayEvent model')
->run('php artisan make:model SaturdayEvent -mf')
->check(Check::classExists('App\Models\SaturdayEvent')),
]);
Follow these rules:
- Give each step a check. Use the helpers in
src/Check.php. - Name app classes as strings. The app must never depend on the guide.
- Put teaching text in the guide, not in comments in the app.
- Put the acceptance test in
stubs/tests. Fix the names of routes, models and tables in the test, so later features can depend on them. - Run
vendor/bin/pest. A test fails if a feature needs a key that does not exist, or if dependencies make a loop.
Remove the guide before handover
The BLSC website must not mention the guide. Before you hand over the repository, run this in blsc-website:
composer remove --dev tru-laravel-club/blsc-guide
Reject pull requests that import TruLaravelClub\BlscGuide in app code.
License
MIT