简体   繁体   English

如何在 Z0659E0DE287281473DA4D859F0B9EF3 中的原始 php 文件中使用 Laravel Eloquent

[英]How to use Laravel Eloquent from raw php file in laravel project

I am currently invoke a raw php file from MySQL trigger.我目前正在从 MySQL 触发器调用原始 php 文件。 It invokes that php file by passing some parameters.它通过传递一些参数来调用 php 文件。 In php file, I noticed I can't use Laravel Eloquent.在 php 文件中,我注意到我不能使用 Laravel Eloquent。 Is there anyway to use Eloquent queries in the raw php file?无论如何在原始 php 文件中使用 Eloquent 查询? I think I can call a function of controller by routing in here raw php file.我想我可以通过在此处的原始 php 文件中路由来调用 controller 的 function 。 Is there any resoultion for this problem.这个问题有没有解决办法。 Thanx谢谢

If you can call a raw PHP file, then you can also wrap its content into an Artisan command which will automatically use Laravel (and Eloquent of course)如果您可以调用原始 PHP 文件,那么您还可以将其内容包装到 Artisan 命令中,该命令将自动使用 Laravel(当然还有 Eloquent)

php artisan yourCommand arg1 arg2 ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM