Laravel Blade视图出现Trying to access array offset on null错误求助
部署到服务器后Laravel视图报错,本地正常,求排查
本地开发环境运行完全正常,但部署到服务器后出现错误,已经卡了快4小时。错误详情记录在FlareApp中。
控制器代码:
public function readBlog($slug, Request $request) { // Update job count views $blogView = blog::where('slug', $slug)->with('user', 'image', 'file', 'categories', 'subcategories')->first(); $blogView->views += 1; $blogView->save(); $blogGet = blog::where('userid', $blogView->user->id)->orderBy('views', 'DESC')->with('image')->limit(3)->get(); return view('home.read-blog', ['blogs' => $blogView, 'blogArr' => $blogGet]); // return response()->json($blogView); }
Blade视图代码:
@extends('welcome') @section('title', $blogs->seo_title ?? $blogs->title) @section('page_description', $blogs->seo_description) @section('page_keywords', 'blog boxity, boxity, boxityerp, realizeboxity, boxity central indonesia, erp boxity, warehouse management, human resources management, financial management, boxity warehouse, boxity WMS, boxity financial, boxity indonesia, news from boxity') @section('tag_cover',$blogs->image->file) @section('content') <section id="single-post" class="wide-100 inner-page-hero single-post-section division"> <div class="container"> blablabla </div> </section>
恳请帮忙排查问题,感谢!
内容的提问来源于stack exchange,提问作者Bin Ski.
相关产品推荐
相关产品推荐

