fixed descriptions
This commit is contained in:
parent
147d680c4a
commit
657f4d67bb
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Beike\Admin\Http\Controllers;
|
||||
|
||||
use Beike\Models\Page;
|
||||
use Illuminate\Http\Request;
|
||||
use Beike\Admin\Repositories\PageRepo;
|
||||
|
||||
|
|
@ -33,6 +34,7 @@ class PagesController
|
|||
{
|
||||
$data = [
|
||||
'page' => PageRepo::findByPageId($pageId),
|
||||
'descriptions' => PageRepo::getDescriptionsByLocale($pageId),
|
||||
];
|
||||
return view('admin::pages.pages.form', $data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@ class PageRepo
|
|||
}
|
||||
|
||||
|
||||
public static function getDescriptionsByLocale($pageId)
|
||||
{
|
||||
$page = self::findByPageId($pageId);
|
||||
return $page->descriptions->keyBy('locale');
|
||||
}
|
||||
|
||||
|
||||
public static function createOrUpdate($data)
|
||||
{
|
||||
$id = $data['id'] ?? 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue