doufutao4428 2017-07-10 10:49
浏览 5

如何从Laravel 5包中发布供应商

So I've my custom Laravel 5.4 package, and i want to publish the vendor packages located into my package, this is my code (PackageServiceProvider.php):

$this->publishes([
  __DIR__.'/../vendor/soundasleep' => public_path('soundasleep'),
], 'html2text');

but when i run php artisan vendor:publish --tag=html2text the vendor is published into public folder and i want to be published into my application vendor, because when i tried use \Html2Text\Html2Text as html2text; into my package routes.php i got class Html2Text\Html2Text not found.

this is my composer :

"require": {
    "soundasleep/html2text": "~0.5"
}

[I wondered if there is some thing like vendor_path ]

so please if someone has any idea i'll be very appreciative.

  • 写回答

1条回答 默认 最新

  • doudao1282 2017-07-10 11:34
    关注

    First, you need to register your package in config/app.php . Add it to the providers array.

    Html2Text\Html2Text\PackageServiceProvider.php::class,

    Third party packages should publish config files into the config directory. In your service provider, you publish it to the public folder public_path('soundasleep').

    Change it to config_path('soundasleep').

    评论

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思