Download the PHP package mccool/laravel-auto-presenter without Composer

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

Laravel Auto Presenter 7

This package automatically decorates objects bound to views during the view render process.

Banner

Build Status StyleCI Status Packagist Downloads Latest Version

Features

Installing

Laravel Auto Presenter requires PHP 7.1-8.1 and supports Laravel 5.5-9. If you need support for older Laravel or PHP versions, please choose an older version of Laravel Auto Presenter.

Auto Presenter L5.1 L5.2 L5.3 L5.4 L5.5 L5.6 L5.7 L5.8 L6 L7 L8 L9
4.3 :white_check_mark: :white_check_mark: :white_check_mark: :x: :x: :x: :x: :x: :x: :x: :x: :x:
5.0 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :x: :x: :x: :x: :x: :x: :x: :x:
6.2 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :x: :x: :x: :x: :x: :x: :x:
7.7 :x: :x: :x: :x: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

To get the latest version, simply require the project using Composer:

Once installed, if you are not using automatic package discovery, then you need to register the McCool\LaravelAutoPresenter\AutoPresenterServiceProvider service provider in your config/app.php.

You can also optionally alias our facade:

Upgrading

Version 6 to 7

In Laravel Auto Presenter 7, note that:

Version 5 to 6

Going from Laravel Auto Presenter 5, to 6, note that:

Version 4 to 5

If you're upgrading from Laravel Auto Presenter 4, to 5, note that:

Usage

To show how it's used, we'll pretend that we have an Eloquent Post model. It doesn't have to be Eloquent, it could be any kind of class. But, this is a normal situation. The Post model represents a blog post.

I'm using really basic code examples here, so just focus on how the auto-presenter is used and ignore the rest.

Also, we'll need a controller..

and a view...

In this example the published_at attribute is likely to be in the format: "Y-m-d H:i:s" or "2013-08-10 10:20:13". In the real world this is not what we want in our view. So, let's make a presenter that lets us change how the data from the Post class is rendered within the view.

Note that the model is injected by calling the setWrappedObject method, inherited from BasePresenter.

We need the post class to implement the interface.

Now, with no additional changes our view will show the date in the desired format.

The Decoratable interface is used to allow the model's relations to be decorated, and the HasPresenter interface (which extends that one) is used to have the model itself decorated.

Troubleshooting

If an object isn't being decorated correctly in the view then there's a good chance that it's simply not in existence when the view begins to render. For example, lazily-loaded relationships won't be decorated. You can fix this by eager-loading them instead. Auth::user() will never be decorated. I prefer to bind $currentUser to my views, anyway.

If an object is a relation of another object and it isn't being decorated in the view, you might not have added the Decoratable interface to the other object. To fix this, add the Decoratable interface to the other object.

Security

If you discover a security vulnerability within this package, please send an email to [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

Laravel Auto Presenter is licensed under The MIT License (MIT).

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of mccool/laravel-auto-presenter and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.


All versions of laravel-auto-presenter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3 || ^8.0
illuminate/container Version ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0
illuminate/contracts Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.0
illuminate/events Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.0
illuminate/pagination Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.0
illuminate/support Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.0
illuminate/view Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.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 mccool/laravel-auto-presenter contains the following files

Loading the files please wait ....