PHPackages                             emadha/eloquent-views - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. emadha/eloquent-views

ActiveLibrary[Templating &amp; Views](/categories/templating)

emadha/eloquent-views
=====================

A Laravel Composer Package which attaches views to Eloquent Models, making it easier to render models views

v1.1.1(4y ago)0124MITPHPPHP ^7|^8.0CI failing

Since Mar 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/emadha/eloquent-views)[ Packagist](https://packagist.org/packages/emadha/eloquent-views)[ RSS](/packages/emadha-eloquent-views/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Laravel Eloquent Views
======================

[](#laravel-eloquent-views)

[![Total Downloads](https://camo.githubusercontent.com/d548950d1ae39702d528bdc8cb4150f6bc4d53f4f03916ccc12d8db4f2aff33e/68747470733a2f2f706f7365722e707567782e6f72672f656d616468612f656c6f7175656e742d76696577732f642f746f74616c2e737667)](https://packagist.org/packages/emadha/eloquent-views)[![Latest Stable Version](https://camo.githubusercontent.com/e5e9a0e667c66363de0b2d0b50f5caf65b13603db748cc8354b57600c246c4d7/68747470733a2f2f706f7365722e707567782e6f72672f656d616468612f656c6f7175656e742d76696577732f762f737461626c652e737667)](https://packagist.org/packages/emadha/eloquent-views)[![License](https://camo.githubusercontent.com/9be5dbeb35b4958b6d3728b01c20e8575caa32c3a93020ed9e0306bff6a6c746/68747470733a2f2f706f7365722e707567782e6f72672f656d616468612f656c6f7175656e742d76696577732f6c6963656e73652e737667)](https://github.com/emadha/eloquent-views/blob/master/License.md)

*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
------------

[](#requirements)

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

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require emadha/eloquent-views
```

The package will automatically register itself.

You can publish the config with:

```
php artisan vendor:publish --provider="EmadHa\EloquentViews\ServiceProvider" --tag="config"
```

The config file has the root diretory of the eloquent views

```
