File size: 423 Bytes
6cd3bab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace App\Http\Controllers;

use Symfony\Component\HttpFoundation\BinaryFileResponse;

class FrontendController extends Controller
{
    public function index(): BinaryFileResponse
    {
        $indexPath = public_path('fe/index.html');

        abort_unless(file_exists($indexPath), 503, 'Frontend build is missing. Run npm --prefix frontend run build.');

        return response()->file($indexPath);
    }
}