如何在外部模块中使用Laravel类


How use Laravel Classes in an external module?

我正在尝试使用Laravel的Auth类来确保FileManager模块的安全。

文件管理器:http://www.responsivefilemanager.com/

文件管理器在我的/public代表上,可以通过以下途径访问:ROOT/Filemanager/dialog.php,无需身份验证。。。这是安全方面的大失误!

为了修复它,我想使用Auth!但我不知道我该怎么做!我试着需要boosrap/start.php文件,但它不起作用。

这就是从外部脚本启动Laravel的方法:

include __DIR__ . '/../vendor/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/start.php';
$app->boot();

现在你可以做:

if ( ! Auth::check()) 
{
    ...
}