Skip to content
Projets

À propos

Toasts and notifications for Laravel + Inertia.js

Développement web et applicatif

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
+1
in 7 days
Historique en cours
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Inertia Notifications

Flash toasts, deliver inbox notifications, and manage notification preferences from Laravel PHP or Laravel Rust. Both use the same Vue and React components.

Inertia Notifications is part of Inertia UI, a suite of packages designed for Laravel, Inertia.js, and Tailwind CSS.

Start by flashing a toast, sending an inbox notification, or publishing an announcement. The guides also show how to read a user’s inbox counts and update their preferences. Full documentation

Sponsor Us

❤️ We proudly support the community by developing Laravel packages and giving them away for free. Please consider sponsoring the maintenance and development when this package saves you time or you rely on it professionally, and check out our premium packages: Inertia Table and Inertia Forms. Keeping track of issues and pull requests takes time, but we're happy to help!

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

The monorepo contains the Laravel PHP backend in src/, Inertia Notifications for Laravel Rust in rust/, and the shared TypeScript client in js/. The Vue and React components live in vue/ and react/. The documentation covers both backends, their requirements, and the differences in storage and delivery.

The PHP demo lives in demo-app/. For the Rust demo, including setup and test commands, see the Laravel Rust example.

The built vue/dist and react/dist folders are committed: the frontend packages ship inside the Composer package, so consumers install them from vendor/inertiaui/notifications/{vue,react} without building the source. Rebuild them with pnpm build and commit them with the source changes. CI fails when they are out of date. The same packages are also published to npm.

Releasing

Run ./release.sh 1.2.3 from an up-to-date main. The script checks CI, bumps the Vue and React package versions, runs composer build, commits the versions and builds, pushes a tag, and creates a GitHub release with notes generated from the merged pull requests. The Update Changelog workflow then adds those notes to CHANGELOG.md and commits it to main, so you don't edit the changelog by hand. The release publishes both packages to npm through the Publish to npm workflow, and Packagist picks up the tag.

The Boost skill in resources/boost repeats each page of the docs for AI agents, as one reference file per page. The reference files and their list in SKILL.md are generated: run pnpm docs:guide after changing a page, and commit the result with the docs. CI fails when they are out of date.

Laravel PHP Demo Setup

composer install
pnpm install
pnpm build
cd demo-app
composer install
cp .env.example .env
php artisan key:generate
php artisan inertia-notifications:vapid --subject=mailto:[email protected]

Then create the demo app's SQLite database with sample notifications:

php artisan migrate --seed

Every demo request is signed in as a demo user, so the notification center works without a login page. In an Amp orb, .agents/setup installs the toolchain and dependencies, creates the database, and builds everything.

Development

From the repository root:

pnpm dev:vue          # Watch & rebuild the Vue library
pnpm dev:demo:vue     # Vue demo Vite server
pnpm dev:react        # Watch & rebuild the React library
pnpm dev:demo:react   # React demo Vite server
pnpm docs:dev         # Documentation

From demo-app/, run APP_STACK=vue php artisan serve --port=8100 or APP_STACK=react php artisan serve --port=8101 for the matching Laravel server. In an Amp orb, amp orb services ensure starts both servers with the built demo assets, and the docs dev server, from .amp/services.yaml.

Quality Checks

For the Rust backend, see the core checks and Laravel integration tests. Run the PHP, frontend and documentation checks from the repository root:

composer metadata:check   # composer validate --strict
composer analyse          # PHPStan level 5
composer format:check     # Laravel Pint and PHP CS Fixer
composer refactor:check   # Rector dry run
composer test             # Pest package tests
pnpm lint:check           # Oxlint
pnpm format:check         # Oxfmt
pnpm test:unit            # Vitest unit tests for js/
pnpm typecheck            # Vue and React packages
pnpm docs:guide:check     # Boost guide matches the docs
composer all              # All of the above
pnpm typecheck:demo       # Vue and React demo code
composer build            # all + typecheck:demo, library/demo/docs builds, and package checks

The package tests run on an in-memory SQLite database. You may run them on MySQL or PostgreSQL, as CI does, by setting the connection in the environment. DB_HOST and DB_PORT default to 127.0.0.1 and the port of the database:

DB_CONNECTION=pgsql DB_DATABASE=testing DB_USERNAME=testing DB_PASSWORD=secret composer test

Browser Tests

The demo app runs Pest Browser tests against the built assets of the stack in APP_STACK. Build the library and demo assets for that stack first, and install Chromium once with pnpm --dir demo-app exec playwright install chromium.

pnpm build:vue && pnpm --filter demo-app build:vue
cd demo-app && APP_STACK=vue vendor/bin/pest

pnpm build:react && pnpm --filter demo-app build:react
cd demo-app && APP_STACK=react vendor/bin/pest

Security Vulnerabilities

Please send an e-mail to Pascal Baljet via [email protected] when you discover a security vulnerability within Inertia UI. All security vulnerabilities will be promptly addressed.

Credits

License

The MIT License (MIT). Please see License File for more information.

Explorer des projets similaires

Chargement…