public function store(Scase $scase) { $this->validate($this->request(), $rules = array('title' => 'required|max:255', 'photos' => 'required'), $message = ['title.required' => '请填写标题', 'title.max' => '标题太长', 'photos.required' => '最少上传一张图片'], $customAttributes = []); $form = $this->request()->all(); $form['cover'] = $form['photos']['0']; $form['photos'] = implode("\n", $form['photos']); if (Scase::create($form)) { return $this->success('添加成功', $scase); } return $this->error('添加失败,请稍后再试'); }