Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

warmwhisky's avatar

Larave 5.2 Access Models, Controllers and Facades in a php script

Hi,

I am looking for a way to access Models, Controllers and Facades in a php script inside of the public folder.

Is this possible? I am using 5.2

So far i have goot

require '/home/ngwenyag/public_html/subs/mtb/vendor/autoload.php';
$laravel_app = require '/home/ngwenyag/public_html/subs/mtb/bootstrap/app.php';
$laravel_app->make('Illuminate\Contracts\Http\Kernel')
    ->handle(Illuminate\Http\Request::capture());

This allows me access to DB but not facades.

Please anyone tell me if its possible or not.

0 likes
0 replies

Please or to participate in this conversation.