Download the PHP package rosalana/safepoint without Composer
On this page you can find all versions of the php package rosalana/safepoint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package safepoint
Rosalana Safepoint is a TypeScript type generator for Laravel + Inertia.js applications.
It generates a single TypeScript file from your Laravel application — models, routes, shared Inertia data, and helper types — all in one flat output optimized for end-to-end type safety.
This package is designed primarily for:
- Laravel developers using Inertia.js
- teams who want type-safe props, route params, and request bodies
- projects that use static analysis over runtime reflection
- monorepo setups with multiple Laravel apps
Installation
Why Safepoint?
Inertia.js moves data between PHP and JavaScript — but without types, that boundary is invisible.
Typing it manually means:
- duplicating model definitions
- guessing what props a page receives
- no autocomplete for route params or request bodies
- types going out of sync as the app grows
Rosalana Safepoint does not require you to write types manually. It reads your Laravel application using static analysis and generates them for you.
[!NOTE] Safepoint uses
laravel/rangerandlaravel/surveyorunder the hood to inspect your models, routes, and shared data without running the application.
What it generates
Running php artisan safepoint:generate produces resources/js/safepoint.ts:
Usage
Options
| Option | Description |
|---|---|
--path= |
Custom output path (default: resources/js/safepoint.ts) |
--base-path= |
Comma-separated base paths (default: base_path()) |
--app-path= |
Comma-separated app paths (default: app_path()) |
--skip-routes |
Skip route and route list generation |
--skip-models |
Skip model interface generation |
--skip-enums |
Skip enum type generation |
--skip-shared-data |
Skip shared data interface generation |
Multiple paths (monorepo)
Only models and routes whose source files are under --app-path are included. Vendor models (e.g. DatabaseNotification from the Notifiable trait) are automatically filtered out.
How it works
Safepoint inspects your application statically — no runtime required:
- Models — attributes from DB schema, relations from PHPDoc
- Enums — PHP backed enums discovered via static analysis
- Routes — HTTP method, URL parameters, request validation rules, Inertia props
- Shared data — from
HandleInertiaRequests::share() - Route list — a runtime-usable
_routesconst and a typedroute()helper
PHPDoc annotations
Since Safepoint uses static analysis, it can't detect runtime behavior like $post->load('user') or manually built responses. Use PHPDoc annotations on controller methods to override or extend the generated types.
| Annotation | Example | Effect |
|---|---|---|
@safepoint-ignore |
@safepoint-ignore |
Skip this route entirely |
@safepoint-include |
@safepoint-include user, comments |
Add relations to the RequiredKeys key list for props |
@safepoint-prop |
@safepoint-prop pagination { current_page: number; total: number } |
Add or override a prop's TypeScript type |
@safepoint-body |
@safepoint-body token string |
Add or override a body field's TypeScript type |
@safepoint-param |
@safepoint-param slug string |
Add or override a URL parameter's TypeScript type |
[!NOTE]
@safepoint-includeonly adds relations that actually exist on the model — unknown relation names are silently ignored.
Working with generated types
PageProps
Use PageProps<T> to get fully typed page props in your Inertia pages:
RouteParams & RouteBody
route() helper
The generated file includes a typed route() helper that builds URLs from route names and parameters:
Extending the generated types
Since the generated file is overwritten on each run, do not edit it directly. Instead, create a separate file and use TypeScript declaration merging:
Import safepoint-extend.ts alongside safepoint.ts and TypeScript will merge the declarations automatically.
License
Rosalana Safepoint is open-source under the MIT license, allowing you to freely use, modify, and distribute it with minimal restrictions.
You may not be able to use our systems but you can use our code to build your own.
For details on how to contribute or how the Rosalana ecosystem is maintained, please refer to each repository's individual guidelines.
Questions or feedback?
Feel free to open an issue or contribute with a pull request. Happy coding with Rosalana!
All versions of safepoint with dependencies
illuminate/support Version ^12.0
illuminate/console Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/routing Version ^12.0
laravel/ranger Version ^0.1.0
laravel/surveyor Version ^0.1.0
phpstan/phpdoc-parser Version ^2.3
