Download the PHP package touhidurabir/laravel-presenter without Composer

On this page you can find all versions of the php package touhidurabir/laravel-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 laravel-presenter

Laravel Presenter

A package that helps to group methods that mostly use for the view presentation purpose.

Installation

Require the package using composer:

To publish the config file:

Configurations

Check the published config file for the details of configurations options.

Usage

First step is to generate a presenter class . To make this process easy, this package comes with a command that helps to generate the presenter classes. To generate the presenter class via command, do as

For example :

will generate a UserPresenter at the App\Presenters namespaced path.

it will have following content

Now to use this with the combination of User model class, drop the HasPresenter trait and defined property $presenter as :

Now to define a method in our presenter class, follow as :

And Now any public method defined in the UserPresenter class can be accesses as :

It is also possible to not define the $presenter property while using the presenter class for models . In that case it will try to resolve the presenter through the model name and default store namespace defined in the config file .

For example, by default it will try to find a class in the App\Presenters location with name of UserPresenter for User model if the $presenter property not set in the User model. If it can find it, then it will use that for User model presenter . If none found, it will throw exception.

It is also possible to set/update the presenter on fly . To do that , need to user the setPresenter method defined in the HasPresenter trait as :

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT


All versions of laravel-presenter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
touhidurabir/laravel-stub-generator Version ^1.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 touhidurabir/laravel-presenter contains the following files

Loading the files please wait ....