示例#1
0
 /**
  * CMS constructor.
  */
 public function __construct()
 {
     $this->lang = App::getLocale();
     $this->path = str_replace('/', '#', Request::path());
     $this->blocks = Block::where('language', $this->lang)->where('path', $this->path)->select('content', 'block')->get()->keyBy('block')->toArray();
 }
示例#2
0
 public function updateBlock(Request $request)
 {
     $block = Block::firstOrCreate($request->only(['path', 'block', 'language']));
     $block->update(['content' => $request->input('content')]);
     return $request->only(['path', 'block', 'language']);
 }