Download the PHP package xtend-packages/rest-presenter without Composer

On this page you can find all versions of the php package xtend-packages/rest-presenter. 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 rest-presenter

RESTPresenter

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

Join our Discord

Introduction

RESTPresenter is a powerful, lightweight package designed to streamline Laravel API development. It integrates seamlessly with Laravel API Resources and Spatie's Data objects, making API creation and management effortless.

With RESTPresenter, you can:

RESTPresenter enhances your Laravel projects with powerful tools for efficient and secure API development.

Installation

To get started with RESTPresenter, you need to meet the following requirements:

Install the package via composer:

Filament Plugin Integration

Manage your RESTPresenter resources directly from Filament with our dedicated plugin. This integration allows you to generate user tokens, manage your API resources, and more.

Plugin Installation

To install the RESTPresenter Filament plugin, run:

This command will prompt you to auto-commit changes to your Git repository. If you choose not to commit, you can manually commit the changes yourself. The Sanctum StarterKit is automatically installed during this process. For more details, see Sanctum StarterKit.

Export API Collection

To generate your API collection, run:

By default, this command generates a Postman collection. If you prefer Insomnia, switch by setting the following in your .env file:

For a full list of configuration options, see Configuration.

Uninstall

To uninstall the RESTPresenter Filament plugin, run:

This command will prompt you to auto-commit and revert changes to your Git repository. If you choose not to commit, you can manually commit the changes yourself.

RESTPresenter Panel

The new RESTPresenter panel serves as a dashboard, offering a comprehensive overview and management interface for your API collection.

RESTPresenter

You can access the RESTPresenter panel by navigating to /rest-presenter in your browser. the path is configurable in the .env file see Configuration for more details.

RESTPresenter panel link has now conveniently been added to the user menu for all your filament panels.

Features include:

Coming Soon: Test Coverage and Reports, just one of many features in active development.

Endpoint Authentication & Security

By default, all endpoints are publicly available without Sanctum middleware, protected by a security API key which you can update via REST_PRESENTER_AUTH_API_KEY in your .env file.

You can make any endpoint authenticated by updating the isAuthenticated property in the resource controller. This will automatically add the Sanctum middleware to the endpoint.

Generated Files

The following directories with generated files will be created:

Filament Test Suite

Tests are generated for each resource in the Filament test suite.

Warning: To prevent overriding your database, update phpunit.xml with the following:

RESTPresenter Package

Key Features

Planned Features

Check out our Roadmap for upcoming features and improvements. Feel free to open an issue for suggestions or feature requests. Join us on Discord to start a discussion and stay updated on the latest news.

What Makes This Package Unique?

RESTPresenter is more than just a CRUD generator. It offers:

So What Are Presenters?

Presenters allow you to transform data before it's sent to the client, enabling modifications without altering API resources. This is particularly useful for transforming data for specific endpoints.

To use a presenter, add the header property X-REST-PRESENTER: PresenterName to your request. RESTPresenter will automatically apply the presenter to the data before sending it to the client. Presenters work with collections, single resources, and nested resources, allowing for data transformation at any response level.

Filament Starter Kit

The RESTPresenter package includes a Filament Starter Kit, providing a robust foundation for your Filament projects:

Need Something More Advanced?

We are developing a full Filament Kit with additional features for comprehensive CRUD generation in your Filament project. This advanced solution is intended for those who require more robust functionality and will be released under a sponsorship model. Once we reach our sponsorship milestones, the full Filament Kit will be open-sourced.

The full kit will save developers time by providing advanced solutions out of the box. However, the Starter Kit still allows for full CRUD implementation, though it may require more time and effort. If you’re interested in the advanced Filament Kit, reach out to us on Discord to express your interest and support its development through sponsorship.

Standalone Laravel Setup

RESTPresenter seamlessly integrates into any Laravel application, allowing you to generate API resources effortlessly from your selected models.

Initial Setup

Customize RESTPresenter for your project with our setup command:

We recommend installing the Sanctum starter kit, so this has been pre-selected for you. Note Filament now has a dedicated command to install the RESTPresenter plugin so has been removed from the setup command.

Generate Resources (Prompts)

To generate a new resource, use the following command:

This command will guide you through creating a new resource. Prompts will allow you to automatically generate presenters, filters, data, and set up your resource ready to use. All model relationships and fields are automatically detected throughout the prompt process. Additionally, we provide a custom option for most prompts to generate without auto-detection.

Configuration

We no longer publish the configuration by default. This is to provide better support for future updates and to prevent conflicts with your existing configuration. If you need to publish the configuration, you can do so with vendor:publish however we do not recommend this approach.

Instead we have made sure that you can override any configuration directly in your .env file. This allows you to customize the package to your needs without the need to publish the configuration.

Here is a list of all available configuration options including their default values:

Changelog

Please see conventional commits standards and updated with each release.

Contributing

Please see our CONTRIBUTING guide if you are thinking of contributing to this package.

License

RESTPresenter is open-source software licensed under the MIT License


All versions of rest-presenter with dependencies

PHP Build Version
Package Version
No informations.
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 xtend-packages/rest-presenter contains the following files

Loading the files please wait ....