Murod
Murod

Reputation: 32

why does View::make() not exist in laravel docs?

why does View::make() not exist in laravel docs? I have gone through on xVersion/views pages of all versions of Laravel docs, but I couldn't find any statement about View::make(). who can explain to me how it works?

additional info, I'm learning Aimeos Laravel package. I don't think View::make is from Aimeos packages. because, I see enter image description here

composer.json

> "require": {
>         "php": "^7.2.5",
>         "aimeos/aimeos-laravel": "dev-master",
>         "fideloper/proxy": "^4.2",
>         "fruitcake/laravel-cors": "^2.0",
>         "guzzlehttp/guzzle": "^6.3",
>         "laravel/framework": "^7.24",
>         "laravel/tinker": "^2.0",
>         "laravel/ui": "^2.4"
>     },

Upvotes: 0

Views: 561

Answers (2)

Martin Bean
Martin Bean

Reputation: 39389

View::make is calling a make method on the View facade. This was how views were referenced in Laravel 4.x, but Laravel 5.x introduced the global view helper that does the same thing, just with a few less keystrokes.

Therefore, View::make('shop::page.privacy') is the same as view('shop::page.privacy').

Upvotes: 2

ceejayoz
ceejayoz

Reputation: 180024

Many things in Laravel have multiple ways of referencing them.

The documentation prefers the use of the cleaner, less verbose view() helper, but you can use View::make if you prefer.

The API docs for View::make are at https://laravel.com/api/8.x/Illuminate/Contracts/View/Factory.html#method_make.

Upvotes: 2

Related Questions