Php 使用cpanel向刀片显示图像

Php 使用cpanel向刀片显示图像,php,html,laravel,Php,Html,Laravel,我正在使用GODADDY作为我的主机,现在我部署我的项目,除了这个图像之外,其他一切都可以正常工作。如何使用Laravel中的图像干预包显示保存到sql数据库中的图像,我在保存图像时没有问题。它可以工作。唯一的问题是如何在我的视图中显示它。我的控制器将在public/uploads路径下保存它 详细信息:$leads=型号,上传*=文件夹,图像=数据库列* 注意:我已经尝试了以下html代码,但仍然不起作用 除上传文件夹外,所有“我的公共项目”都已移至“公共html” <img src="

我正在使用GODADDY作为我的主机,现在我部署我的项目,除了这个图像之外,其他一切都可以正常工作。如何使用Laravel中的图像干预包显示保存到sql数据库中的图像,我在保存图像时没有问题。它可以工作。唯一的问题是如何在我的视图中显示它。我的控制器将在public/uploads路径下保存它

详细信息:$leads=型号,上传*=文件夹,图像=数据库列*

注意:我已经尝试了以下html代码,但仍然不起作用 除上传文件夹外,所有“我的公共项目”都已移至“公共html”

<img src="{{ asset($leads->image) }}" />--this is not working
<img src="{{ asset('uploads/' . leads->image) }}" />--this is not working
<img src="{{ asset('uploads')}}/{{ $leads->image) }}" />--this is not working
<img src="{{ URL::asset('storage/uploads'.$leads->image) }}">
<img src="/uploads/{{$leads->image}}" >--only works in my local computer
])


有人能给我指出正确的方向/或教程吗?

是的,我找到了答案,但遗漏了一些部分

最终代码:

{{ URL::asset('public/uploads/'.$leads->image)}}

您可以检查那些不工作的脚本显示的路径,然后从那里开始工作。对损坏的图像执行inspect元素,查看它们的路径。您只需将虚拟主机指向laravel
public
文件夹,而不是默认的
public\u html
@rkj如何指向我的public?您有权访问服务器的apache吗?@hungrykoala yow谢谢inspect元素回答我的问题哈哈,我错过了一些/沿着代码走谢谢你。。
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/

'default' => env('FILESYSTEM_DRIVER', 'local'),

/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/

'cloud' => env('FILESYSTEM_CLOUD', 's3'),

/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "s3", "rackspace"
|
*/

'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
    ],

],
{{ URL::asset('public/uploads/'.$leads->image)}}