Download the PHP package emadha/eloquent-views without Composer

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

Laravel Eloquent Views

Total Downloads Latest Stable Version License

A Composer Package to attach a render method to eloquent models.

I find it easier to render models views using a single line of code like model->render('view'); instead of going to controller, or having it inside a @include in blade, or by using multiple lines of code to achieve that. With this package, you can easily do so.

Requirements

This package requires Laravel 5.8 or higher, PHP 7.2 or higher.

Installation

You can install the package via composer:

The package will automatically register itself.

You can publish the config with:

The config file has the root diretory of the eloquent views

Usage

Adding HasEloquentViews trait to your eloquent models is all you need to start using this package.

The views directory structure is like this: resources/views/eloquent/{model}/{view} where eloquent is defined in the config file and model is your lowercase model class e.g. post and the view is the view you request to render.

Example:

This code will look into /resources/views/eloquent/post/block.blade.php and render it.

You can access that data like how you normally would, from a view:

The Beauty of it

How about you use this instead of including or creating the same code all the time ?

And not just that, imagine if you want to have the rendered view output in your controller, for example and api, or search controller, where you want to get the output? This will make this side of project as simple as it can be!

Thank you.


All versions of eloquent-views with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^7.0|^8.0|^9.0
php Version ^7|^8.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 emadha/eloquent-views contains the following files

Loading the files please wait ....