renedekat/laravel-view-finder-creater

A Laravel view finder replacement that creates missing views with a template layout.

v2.0.2 2017-01-18 15:11 UTC

This package is not auto-updated.

Last update: 2024-04-13 17:41:12 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

Build Status StyleCI Scrutinizer Code Quality SensioLabsInsight

Laravel View Finder that creates missing view files

By default Laravel throws an error when a view file cannot be found. This package replaces the default view finder, and creates your missing view files on the fly, based on a template.

The default template can be found in resources/assets/pages/missing.blade.php after you've published it.

Installation

Via Composer

$ composer require renedekat/laravel-view-finder-creater --sort-packages

Replace the default ViewServiceProvider

// config/app.php
'providers' => [
	...
	//Illuminate\View\ViewServiceProvider::class,
	ReneDeKat\LaravelViewFileFinder\ViewServiceProvider::class,
];

Or, if you only want to use it locally (handy during development)

// config/app.php
'providers' => [
	...
	//Illuminate\View\ViewServiceProvider::class,
];
// app/Providers/AppServiceProvider
public function register()
{
    ...
    if ('local' == $this->app->environment()) {
        $this->app->register(\ReneDeKat\LaravelViewFileFinder\ViewServiceProvider::class);
    } else {
        $this->app->register(\Illuminate\View\ViewServiceProvider::class);
    }
    ...
}

The missing page template file must be published with this command:

php artisan vendor:publish --provider="ReneDeKat\LaravelViewFileFinder\ViewServiceProvider" --tag="assets"

It will be published in resources/assets/pages/missing.blade.php

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email renedekat@9lives-development.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.