Make sure that
- You have the document root set to /public
- Make sure that you have mod_rewrite enabled if it served by apache.
- Make sure that the index.blade.php file is in resources/views
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Website URL: littlesmartdaycare infinityfreeapp com
I am currently hosting my website on IF(infinityfree) subdomain.
This is the error I am running into. I googled and asked ChatGPT, all suggested that my controller is unable to locate my blade view, index.blade.php. However, I tested in my local environment and it ran successfully, then I uploaded my folder as is to IF filemanager via WinSCP. I understand that IF lack the command CLI to run compile & caching, so I did all that in my local machine then upload the updated files(Please let me know if this is incorrect, I am still inexperienced on this subject).
I will provide as much relevant code snippet as I believe so below:
index.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Little Smart Day Care Centre</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css">
@include('components.header')
<script src="https://code.tidio.co/0i12wozmwajexcywukm95pjuqf8tphpx.js" async></script>
</head>
<body>
@include('components.navbar')
<section>
@include('components.alert_notification')
@auth
<h1>Welcome, {{ Auth::user()->name }}.</h1>
@else
<h1>**partially removed due to containing non-English words** Little Smart Day Care Centre</h1>
@endauth
<br>
<div class="center">
<h2>Announcement</h2>
@if ($posts->isEmpty())
@include('components.no_records')
@else
@foreach ($posts as $post)
<section>
<p>{{ $post->createdtime->format('Y-m-d H:i') }}</p>
@if (!empty($post->images))
<div class="slick-carousel">
@foreach ($post->images as $image)
<div><img src="{{ asset('storage/uploads/' . $image) }}" alt="{{ $post->title }}" /></div>
@endforeach
</div>
@endif
<h3>{{ $post->title }}</h3>
@if ($post->description)
{!! $post->description !!}
@endif
</section>
<br>
@endforeach
<nav aria-label="Page navigation">
{{ $posts->links('pagination::bootstrap-4') }}
</nav>
@endif
</div>
</section>
@include('components.send_feedback')
@include('components.footer')
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.js"></script>
<script>
$(document).ready(function(){
$('.slick-carousel').slick({
dots: true,
adaptiveHeight: true,
});
});
</script>
</body>
</html>
PostController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Post;
class PostController extends Controller
{
/**
* (CRUD read)
* Display a listing of the resource, exclusive for announcement page.
*
* Retrieves all records from 'posts' table, split into several pages,
* Decode JSON data for 'posts.images', which converts JSON string to
* PHP array. Pass final data to blade view.
*/
public function indexHome()
{
// Cut-off point for page nav btn is 15 pages (ellipsis will appear)
$posts = Post::orderBy('createdtime', 'desc')->paginate(5); // number of records per page
$posts->getCollection()->transform(function ($post) {
$post->images = json_decode($post->images);
return $post;
});
// pass an empty variable
// $posts = collect();
return view('index', compact('posts'));
}
}
web.php
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PostController;
use App\Http\Middleware\CheckSessionTimeout;
Route::middleware([CheckSessionTimeout::class])->group(function () {
Route::get('/', [PostController::class, 'indexHome']
)->name('index');
});
Extra Question: have you check your .env config and recache your config?
Answer: I did check .env as ChatGPT suggested before, as shown here
.env
APP_NAME="Little Smart Day Care Centre"
APP_ENV=local
APP_KEY=base64:D02P6ouibQnY+YdnpdMgDxYVpD8e6TP9ls/NmeL+SeA=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=**removed due to unable to post link**
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=sql110.infinityfree.com
DB_PORT=3306
DB_DATABASE=if0_37135633_littlesmartdb
DB_USERNAME=if0_37135633
DB_PASSWORD=**removed to protect privacy**
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=**removed due to unable to post link**
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=a8170dee1ad9f9
MAIL_PASSWORD=**removed to protect privacy**
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"
On a side note, the reason I keep my env as local is due to my settings here:
AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Convert HTTP to HTTPS when
// [.env] file [APP_ENV] variable = "production"
if ($this->app->environment('production')) {
URL::forceScheme('https');
}
}
}
And for people who want me to double check my uploaded directory, here are my screenshots: (I am unable to post link on first day, I'll think of a solution in a while)
These are all the relevant info I can think of, please let me know how can I assist in pointing out the root cause. Thank you.
I finally traced the issue from the new observation.
Source issue: /htdocs/bootstrap/cache/config.php
Even though I manually cached & updated my files, this particular file doesn't update for the most part, for the code block in question here:
'view' =>
array (
'paths' =>
array (
0 => 'C:\\laravel_little_smart_website\\resources\\views',
),
'compiled' => 'C:\\laravel_little_smart_website\\storage\\framework\\views',
),
They are all pointing to my local setup, so after I change it to point to host folder:
'view' =>
array (
'paths' =>
array (
0 => '/home/vol14_2/infinityfree.com/if0_37135633/htdocs/resources/views',
),
'compiled' => '/home/vol14_2/infinityfree.com/if0_37135633/htdocs/storage/framework/views',
),
It finally works. Infinityfree unable to access command panel is really tedious.
Please or to participate in this conversation.