Download the PHP package hosseinkalateh/simple-dto without Composer

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

Simple-Dto

DTOs (Data Transfer Objects) are objects that help facilitate the transfer of data between application layers, ensuring a structured and predictable format for the data being passed around.

Why Use DTOs?

Data Transfer Objects improve the separation of concerns by isolating data representation from the core business logic, making your code more maintainable and robust. They act as a layer between controllers, services, and models, providing more control over the data structure and improving security by limiting exposed data fields.

Features

Usage

Creating a DTO

To create a new DTO class, you can use the following artisan command

This command will generate a new DTO class file in the app/DTO directory, ready for you to define the data structure.

You can define typed properties in your DTO outside the constructor:

Remember that the property name convention can be whatever you want.

Creating a Form Request

To create a new Form Request class, you can use the following artisan command

In this command the --dto specifies the corresponding dto.

NOTE : --dto is required.

This command will generate a From Request file in the appropriate directory with the properties defined in the dto.

Using DTO

Now in the controller, you can access the request and the DTO also.

NOTE : $request->toDto() will return the DTO instance that we passed to the make request command.


All versions of simple-dto 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 hosseinkalateh/simple-dto contains the following files

Loading the files please wait ...