在Laravel Inspire类中如何添加更多引用?

huangapple go评论42阅读模式
英文:

How to add more quotations in Laravel Inspire class?

问题

如何在Laravel Inspire类中添加更多的引用?由于这个文件位于vendor文件夹中,而这个文件夹不会直接上传到生产环境。

我在互联网上尝试过。我正在寻找一个可以在生产环境中使用的答案。

英文:

How to add more quotations in Laravel Inspire class? As this file comes inside vendor folder and this folder is not beind uploaded directly on production.

I tried over the internet. I looking for an answer which is production ready.

答案1

得分: 0

1-将供应商中的启发类复制到应用程序文件夹的任何位置,并添加您喜欢的引号。

2-相应地更改命名空间。

3-在routes/console.php文件中添加:use App\XXX\Inspiring;(用正确的路径替换XXX),并删除use Illuminate\Foundation\Inspiring;

运行该命令,它应该能够工作。

另一种方法是扩展原始类。

英文:

1-copy the inspiring class in the vendor anywhere in the app folder and add the quotes you prefer.

2-change the namespace accordingly

3-in the routes/console.php file add: use App\XXX\Inspiring; (replace XXX with the correct path) and delete use Illuminate\Foundation\Inspiring;

run the command and it should work.

another approach could be to extend the original class.

huangapple
  • 本文由 发表于 2023年3月31日 18:55:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75897727.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定