Download the PHP package grantholle/api-resource-detection without Composer

On this page you can find all versions of the php package grantholle/api-resource-detection. 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 api-resource-detection

API Resource Detection

This package provides a trait to add to your Eloquent models to get automatic API Resource detection.

Installation

Usage

You generate resources for your models by using the php artisan make:resource command. This will create a resource in your app/Http/Resources directory. This package detects different naming conventions. You can name your resources the same as your model or name it using the Resource suffix, like ModelResource In your models that have resources, you can add the HasResource trait.

Assume we have a resource named UserResource.

Let's add the trait to the User model:

Now when you want to get the resource for the model, you can call toResource() on the model instance to detect and retrieve the API resource for the model.

You can also use the alternative syntax of Model::resource().

This also works for collection of models.

This will automatically look for a UserCollection or UserCollectionResource resource class. If none is found it will default to calling the collection() function on the standard resource class.

If your application has a different namespace other than the default resource namespace, you can tell it to use a different namespace for your resources.

In a service provider,

You can also change how the resources is guessed and return a new class name based on the model. By default, it looks for your model name or model name with the Resource suffix in the default resource namespace. You can also customize how collections are resolved.


All versions of api-resource-detection with dependencies

PHP Build Version
Package Version
Requires illuminate/http Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.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 grantholle/api-resource-detection contains the following files

Loading the files please wait ....