Website URL
http://littlesmartdaycare.infinityfreeapp.com/
This is my landing page.
Error Message
Currently, the server indicates unable to locate my blade view files. However, in my local environment with the same settings, the server can run normally, I don’t understand what went wrong here.
ChatGPT suggestion: Hosting Issues: If the issue persists after verifying these details, consider contacting InfinityFree support. There may be server-specific configurations or limitations that are affecting your file access.
As of posting, the error message should be:
InvalidArgumentException View [index] not found.
Other Information
I double checked filemanager.ai that my blade view, index.blade.php, is present. I’ll share my code snippets here for direct reference, hope it helps.
PostController.php
<?php
namespace App\Http\Controllers;
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;
// Session timeout check wrapper
Route::middleware([CheckSessionTimeout::class])->group(function () {
// true landing page
Route::get('/', [PostController::class, 'indexHome']
)->name('index');
});
I briefly reviewed similar topics, most of them ended unfinished, or at least unable to resolve my current issue. I manually cached my website and updated the host files, my
.env
APP_URL=local
is due to my
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');
}
}
}
automatically redirect to https format, which is still under testing, thus I the env is set to local to adhere to http format at the meantime.
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.