标签:pass pre his original tor name table admin user
function add(Da $req){
$file= $req->file("file"); //接前台值
$tu=$file->getClientOriginalName(); //图片路径
$data=$file->move("image",$tu);
$all= $req->all(); 接收所有的值
$all[‘file‘]=$data;
$model=new User();
$res=$model->adddo($all);
if ($res){
return redirect()->route("admin.login")->with("mes","请重新登录");
}
}
//model层
class User extends Author
{
public $table="Users";
public $timestamps=false;
function adddo($data){
$this->name=$data[‘name‘];
$this->email=$data[‘email‘];
$this->password=bcrypt($data[‘password‘]);
$this->file=$data[‘file‘];
return $this->save();
}
标签:pass pre his original tor name table admin user
原文地址:https://www.cnblogs.com/azzy/p/11748802.html