您现在的位置是:网站首页> 编程资料编程资料

在laravel5.2中实现点击用户头像更改头像的方法_php实例_

2023-05-25 298人已围观

简介 在laravel5.2中实现点击用户头像更改头像的方法_php实例_

视图层

!!!自己下载jquery文件和ajaxfileUpload的插件

控制器层

$arr]); } //修改图片 public function up_img(Request $Request){ $n_file = Input::file('touxiang'); if($n_file->isValid()){ //获取文件名称 $clientName = $n_file -> getClientOriginalName(); $realPath = $n_file -> getRealPath(); //获取图片格式 $entension = $n_file -> getClientOriginalExtension(); //图片保存路径 $mimeTye = $n_file -> getMimeType(); $path = $n_file -> move('IMG'); } $ress = DB::table('r_nav')->where('n_id',11)->update(['n_img'=>$path]); } } 

以上这篇在laravel5.2中实现点击用户头像更改头像的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

-六神源码网