PHPackages                             gregoriohc/laravel-preview - 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. gregoriohc/laravel-preview

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

gregoriohc/laravel-preview
==========================

Views preview package for Laravel

v1.0.2(9y ago)21961MITPHPPHP &gt;=5.4.0

Since Sep 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/gregoriohc/laravel-preview)[ Packagist](https://packagist.org/packages/gregoriohc/laravel-preview)[ Docs](https://github.com/gregoriohc/preview)[ RSS](/packages/gregoriohc-laravel-preview/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

Preview
=======

[](#preview)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cdbb72f48cfc88f19de66479fed23243d4afbf8402780ce730a0d60d9fbd685d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677265676f72696f68632f6c61726176656c2d707265766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gregoriohc/laravel-preview)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ae17f229b8e97f1152cc27226e34194133afdf38468411a86f99c068d8358095/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f677265676f72696f68632f6c61726176656c2d707265766965772f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/gregoriohc/laravel-preview)[![StyleCI](https://camo.githubusercontent.com/fc4fa69930f12caa5e8013b7e8432681aec75a79c46534bb9ba0d476a01862dc/68747470733a2f2f7374796c6563692e696f2f7265706f732f36363537393531332f736869656c64)](https://styleci.io/repos/66579513)[![Quality Score](https://camo.githubusercontent.com/9f982ecd18003a50ac44fb7f6311c10e753b6023389594caecd328ed96a2c702/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f677265676f72696f68632f6c61726176656c2d707265766965772e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gregoriohc/laravel-preview)[![Code Climate](https://camo.githubusercontent.com/578ea8f76d2dfe93c4f814a94930787fca280eeaa507f39272e919111d41a9a4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f677265676f72696f68632f6c61726176656c2d707265766965772f6261646765732f6770612e737667)](https://codeclimate.com/github/gregoriohc/laravel-preview)[![Test Coverage](https://camo.githubusercontent.com/5c096428707e6f776073f5928db41ea136e108bb6511ac50e5ed1ef7286958ee/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f677265676f72696f68632f6c61726176656c2d707265766965772f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/gregoriohc/laravel-preview/coverage)[![Total Downloads](https://camo.githubusercontent.com/a1924135800ac17b8a1aa658a8783c806ef262fb3a1255ec2130a1472860a9a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677265676f72696f68632f6c61726176656c2d707265766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gregoriohc/laravel-preview)

**WARNING: USE THIS PACKAGE ONLY IN LOCAL/DEBUG MODE! ENABLING THIS PACKAGE IN PRODUCTION ENVIRONMENTS CAN REPRESENT A BIG SECURITY ISSUE!**

View preview package for Laravel

This package can be used to preview your laravel views without needing to create a route or controller to load the view. It can also be useful if you want to preview your emails views without needing to send them.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require gregoriohc/laravel-preview
```

You must install the service provider:

```
// config/app.php
'providers' => [
    ...
    Gregoriohc\Preview\PreviewServiceProvider::class,
],
```

Usage
-----

[](#usage)

Now, if you are in local environment with debug mode enabled, you can access the preview route.

The preview route path has the following structure: `/_preview/{view}?{params}`

The `{view}` can be any app or package view, using the dot and namespace notation of Laravel (ex.: welcome, errors.503, mypackage::myview)

For example, if you want to preview the Laravel default welcome page, you can go to: `/_preview/welcome`

The optional `{params}` can be a list of parameters that will be converted to variables and passed to the view. The key of the parameter will be the variable name, and the value will be transformed depending on its format. The possible formats are the following:

- Object from json: If you pass a json string, it will be automatically converted to an object. For example: `user={"name": "John Doe", "email": "johndoe@example.com"}`
- Model object: To load a model object, just pass (separated by `::`) the model class (with full namespace) and the object ID you are looking for. For example: `user=App\User::1`.
- Class method call: To call a class method, just pass (separated by `::`) the class (with full namespace), the method, and a list of params. For example: `appname=Config::get::app.name` or `something=MyClass::myMethod::param_1::param_2::param_3`. If the method is static, it will called statically, if not, a class object will be instantiated and the method will be called.
- On any other case, the value will be passed without changes

More examples:

- `/_preview/emails.user.welcome?user=App\User::1`
- `/_preview/admin.user.show?user=App\User::1`
- `/_preview/mypackage::my.fantastic.view?something=Cache::get::something&anotherthing=textcontent&somenumber=123`

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Gregorio Hernández Caso](https://github.com/gregoriohc)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3587d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566841?v=4)[Gregorio Hernández Caso](/maintainers/gregoriohc)[@gregoriohc](https://github.com/gregoriohc)

---

Top Contributors

[![gregoriohc](https://avatars.githubusercontent.com/u/566841?v=4)](https://github.com/gregoriohc "gregoriohc (17 commits)")

---

Tags

laravelpackageviewpreview

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gregoriohc-laravel-preview/health.svg)

```
[![Health](https://phpackages.com/badges/gregoriohc-laravel-preview/health.svg)](https://phpackages.com/packages/gregoriohc-laravel-preview)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M137](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M123](/packages/laravel-pulse)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

267880.7k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
