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
});

tvbeek liked this reply

1
moderator

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!

Eventy

Your banner here too?

Neru Tokisaki neru_x Joined 2 May 2022

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.