Download the PHP package nextphp/rest without Composer

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

NextPHP Rest Package

The NextPHP Rest package provides powerful routing capabilities and HTTP handling for PHP developers. This package supports all RESTful methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, PRI) and various response formats such as JSON, XML, HTML, TEXT, and CSV. It simplifies the creation of APIs by allowing developers to define routes and controllers using attributes, ensuring a clean and efficient codebase.

This package is part of the NextPHP Framework, a modern and lightweight PHP framework designed for performance and scalability. NextPHP aims to provide a comprehensive suite of tools and libraries to streamline the development process.

Features

Installation

Installing via Composer

To install the NextPHP Rest package, you need to add it to your project using Composer.

Example Project using NextPHP Rest

This is an example project demonstrating the usage of the NextPHP Rest package, which includes routing and HTTP handling capabilities.

Basic Usage Defining Routes Define routes using attributes to map HTTP methods to controller actions.

Usage

Using Controller

Advanced Entity Usage

Middleware Usage

Define middleware using attributes to apply them to routes. You can apply middleware to an entire controller class with #[Middleware(AuthMiddleware::class)], or to individual routes with method-specific attributes.

Generate AuthMiddleware Class

AuthMiddleware handle JWT authentication check for HTTP request and response.

Service Layer Example

Services provide business logic and interact with repositories.

Example Project

Example for your Project Structure

Example or example.php

To use the NextPHP Rest package, you can create an index.php file and use the router to handle various HTTP requests. Here is an example of how you can do this:

Example index.php

Contributing

We welcome contributions! Here’s how you can help:

For more details, see our Contribution Guidelines.

Resources

Join Our Community

Contact Us

Thank you for being part of the NextPHP community!





FAQ

Q: How do I define a route?

A: Use the #[Get], #[Post], #[Put], #[Delete], #[Patch], etc. attributes to define a method as a route handler. Use #[RouteGroup] to define a common prefix for a group of routes.

For more details, see our FAQ.


All versions of rest with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 nextphp/rest contains the following files

Loading the files please wait ....