Download the PHP package scalar/laravel without Composer

On this page you can find all versions of the php package scalar/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel

Scalar for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Use your OpenAPI documents to render modern API references in Laravel

Installation

Install the package via Composer:

Then run the install command to publish the config file and finish setup:

That’s everything you need to get started. Prefer to publish things manually? You can:

Usage

You’ll need an OpenAPI (formerly Swagger) document to render your API reference. Several packages can generate one from your Laravel app:

Point Scalar at your document in config/scalar.php. You can provide it in three ways:

A URL fetched by the browser — a path served by your own app, or an absolute URL:

A relative URL just needs to be reachable on the same origin. An absolute, cross-origin URL needs to be publicly accessible (and may go through the built-in proxyUrl).

A local file read on the server and embedded in the page — it never needs to be publicly accessible:

Inline content — the raw OpenAPI document as a JSON or YAML string:

When more than one is set, file takes precedence over content, which takes precedence over url. Then visit /scalar to see your API reference.

Scalar client

The default CDN URL loads the latest Scalar client independently of Composer releases. Set cdn to choose a specific version or a self-hosted standalone bundle.

The Laravel theme, application title, proxy URL, and other published defaults stay unchanged. Review configuration.proxyUrl if requests should not use Scalar's public proxy.

Theme

The reference ships with a Laravel-flavored theme, enabled by default ('theme' => 'laravel' in the config). Scalar also comes with a range of built-in themes — see the configuration.theme option in config/scalar.php for the full list.

Multiple documents

Render more than one OpenAPI document behind a document switcher — useful for versioned APIs (v1, v2) or public vs. internal references. Define them in the sources config:

Each source accepts a title, an optional slug, one of url/content/file, and an optional default flag.

You can also register documents at runtime with the Scalar facade — for example in a service provider — which is handy when the list is dynamic:

Registered documents take precedence over the sources config. Document inputs belong in the top-level url, content, file, and sources settings. These keys are ignored inside configuration, so the rendered configuration contains only the selected document input.

Use configuration for other Scalar options. Configuration is serialized as JSON, so JavaScript callbacks cannot be supplied as PHP closures.

Under Laravel Octane the manager is a long-lived singleton, so register documents once (in a service provider). If you register per request, call Scalar::flush() first to avoid them stacking up.

Authorization

The Scalar API reference may be accessed via the /scalar route. By default, everyone will be able to access this route. However, within your App\Providers\AppServiceProvider.php file, you can overwrite the gate definition. This authorization gate controls access to Scalar in non-local environments. You are free to modify this gate as needed to restrict access to your documentation:

The gate protects the reference page. A document fetched from a URL needs its own access rules. To keep a local document behind the page's gate, use file or content; authorized viewers receive the document in the HTML.

Testing

Changelog

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

Contributing

Contributions are welcome.

Credits

License

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


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package scalar/laravel contains the following files

Loading the files please wait ...