Support the ongoing development of Laravel.io →
Artisan Views
0

Laravel can't find a view by the name post


Btw, if you add

```php

```

around your code, it will be formatted. Like below:

// this is my code
// posts
Route::get('post', function () {
    return view('post', [
        // DIR = directory
        'post' => file_get_contents(DIR . '/../resources/posts/my-first-post.html')
    ]); // direct to default welcome page
});
1

It will search for for the file post.blade.php in resources/views. That means it will search for resources/views/blade.php

0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

Neru Tokisaki Neru Tokisaki neru_x Joined 2 May 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.