N
N
NubasLol2019-09-02 17:11:34
Laravel
NubasLol, 2019-09-02 17:11:34

How to override the view::make method?

Tried like this

use Illuminate\Contracts\View\Factory as ViewFactory;
use App\Services\ViewFactory as Factory;

$this->app->bind(ViewFactory::class, Factory::class);

but i get an error
Target [Illuminate\View\ViewFinderInterface] is not instantiable while building [App\Services\ViewFactory].

My service
namespace App\Services;

use Illuminate\View\Factory;

class ViewFactory extends Factory
{

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Razgelday, 2019-09-03
@NubasLol

NubasLol ,
Want to add a common variable to all templates?
If yes, then there is a special opportunity for this, see the docs: https://laravel.com/docs/master/views#sharing-data...
If not, then write why exactly you need to replace the ::make( ) ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question