我从数据库和本地存储中删除图像的方法。 p>
< code> public function destroy($ id){ $ image = DB :: table('images') - &gt; where('id','=',$ id) - &gt; first(); / / print_r($ image); // return'end'; File :: delete(public_path()。'/ images / gallery / thumb-'。$ image-&gt; path); File :: delete(public_path()。'/ images / gallery /'。$ image-&gt; path); $ image-&gt; delete(); 返回Redirect :: back() - &gt; with(' form_success',1) - &gt; with('form_message','Image successfully deleted!'); } code> pre>如果我尝试返回值
$ image code>我得到: p>
stdClass Object([id] =&gt; 49 [site_id] =&gt; 1 [page_id] =&gt; [location] =&gt;图库[alt] =&gt; [路径] =&gt; 60e52a2755ffe8923d5ac1232f5d9154.jpg) code> pre>
那么我的代码出了什么问题? 现在我的Laravel版本是4.2.1,但我尝试将他降级到4.1.17,但没有变化。 p> div>