Download the PHP package benyaminrmb/laravel-dynamic-resources without Composer

On this page you can find all versions of the php package benyaminrmb/laravel-dynamic-resources. 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-dynamic-resources

Laravel Dynamic Resources

Define every API representation of a model in one Laravel resource. Views are composable, safe for loaded relationships, and represented by real PHP constants and methods that IDEs can discover.

Installation

Laravel 12 and 13 and PHP 8.3–8.5 are supported.

One resource, every response

The method name becomes the kebab-case view name: minimalWithAvatarFields() defines minimal-with-avatar. Use name: on #[View] when an explicit name is clearer.

Exactly one view must have default: true. Only views with requestable: true may be selected through HTTP query parameters.

IDE-discoverable selection

Synchronize real constants and fluent methods after adding or renaming a view:

Both forms are real PHP—not runtime magic:

Use the check command in CI:

Composing views

Pass one view or several:

Views resolve from left to right; later fields replace matching earlier fields. withoutView() accepts a string or array too.

For a combination used throughout the application, define a named view and call the component methods directly with combine(), as shown by minimalWithAvatarFields(). This gives PHPStorm and refactoring tools real method references.

Fields and relationships

String entries lazily read the corresponding model attribute. Named entries transform or condition values using the normal Laravel resource API:

relation() only serializes an already-loaded relationship. It never runs a query:

It resolves the related resource through Laravel conventions, supports one/many relations, and accepts resourceClass: when a project uses a custom location.

Filtering and safe request views

Request selection is explicit:

Clients may request allowlisted views and sparse fields:

Malformed, oversized, too-deep, or non-requestable selections produce HTTP 400 responses. Parameter names and limits are configurable in config/dynamic-resources.php.

Commands

See UPGRADE.md for migration from v2.

Quality

Laravel Dynamic Resources is open-source software licensed under the MIT license.


All versions of laravel-dynamic-resources with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
symfony/http-kernel Version ^7.2|^8.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 benyaminrmb/laravel-dynamic-resources contains the following files

Loading the files please wait ...