Download the PHP package fnematov/scramble-laravel-data without Composer

On this page you can find all versions of the php package fnematov/scramble-laravel-data. 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 scramble-laravel-data

Scramble for Laravel Data

A fork of dedoc/scramble that teaches Scramble to understand spatie/laravel-data Data classes.

Scramble generates OpenAPI 3.1.0 documentation for a Laravel application straight from your code, without asking you to write PHPDoc annotations. Upstream Scramble infers types from plain PHP, Eloquent models and API resources — but it does not know about Spatie\LaravelData\Data, so a Data class used as a request payload or returned from a controller ends up documented as a bare object. This fork fills that gap.

Heads up: this fork ships under the Fnematov\ScrambleLaravelData\ namespace, not Dedoc\Scramble\. It registers the same scramble config file, views and /docs/api routes as upstream, so install one or the other — not both.

Installation

The service provider is auto-discovered. After install you have two routes:

By default these are available only in the local environment. You can change that by defining the viewApiDocs gate.

What this fork adds

Data classes as request payloads

Type-hint a Data class on a controller action and its public properties are documented as the request body — or as query parameters for GET, HEAD and DELETE routes.

A property is marked required unless its type allows null or it declares a default value.

If the Data class also defines rules(), only one schema is produced — the extractor tells Scramble's form-request path to stand down, so you no longer get a duplicated request body.

Validation attributes become schema constraints

Spatie validation attributes are translated into real OpenAPI keywords instead of being dropped:

Attribute OpenAPI output
#[Email] format: email
#[Url] format: uri
#[Uuid] / #[Ulid] format: uuid / format: ulid
#[IP], #[IPv4] format: ipv4
#[IPv6] format: ipv6
#[DateFormat('Y-m-d')] format: date
#[DateFormat('Y-m-d H:i:s')] format: date-time
#[Min], #[Max], #[Size], #[Between] minLength/maxLength, minimum/maximum or minItems/maxItems, picked from the property type
#[Regex] pattern, with the PHP delimiters stripped
#[Nullable] nullable type

List and paginated responses

Add the HasPaginatedResponse trait to a Data class to return documented collection responses:

paginated() documents and returns:

list() documents and returns { "items": [...] }. The item schema is a $ref to the Data class, so it is not inlined at every call site.

Property types Scramble now resolves

Documentation

Everything not listed above behaves exactly like upstream Scramble, whose full documentation lives at scramble.dedoc.co.

Credits

Scramble is built by Roman Lytvynenko and the dedoc team. This fork only adds the spatie/laravel-data layer on top; all credit for the documentation generator itself belongs upstream.

License

MIT. See LICENSE.md.


All versions of scramble-laravel-data with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^11.0|^12.0|^13.0
myclabs/deep-copy Version ^1.12
nikic/php-parser Version ^5.0
phpstan/phpdoc-parser Version ^1.10|^2.0
spatie/laravel-data Version ^4.0
spatie/laravel-package-tools Version ^1.9.2
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 fnematov/scramble-laravel-data contains the following files

Loading the files please wait ...