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
It will search for for the file post.blade.php
in resources/views
. That means it will search for resources/views/blade.php
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community