dpmpa26468 2019-01-08 08:41
浏览 20
已采纳

如何在laravel中的yajra数据表中显示图像

i'm getting only getting path of my image file not image in yajra datatable in laravel..

i already did the steps mentioned on how to show image in yajra datatable column , laravel5.3

but did not help..

my datatable code

editColumn('id_image', function(User $user){
        $url = url("storage/uploads/users/".$user->id. "/".$user->id_image);        
        return '<img src="'. $url .'" />'; 
});

it only returns path of my image, it returns like below

<img src="http://127.0.0.1:8000/storage/uploads/users/38/maruti-suzuki-omni.jpg" />
  • 写回答

1条回答 默认 最新

  • doujun7161 2019-01-08 08:55
    关注

    you need to update the rawColumns with your column name. suppose your column name is vehicle_image then

    // public function dataTable($query)
    ->rawColumns(['vehicle_image', 'action']);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Error in check.length("fill") : 'gpar'成分'fill'的长度不能为零
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导