add account sidebar
This commit is contained in:
parent
6f27f76f80
commit
b05b3b68b2
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
namespace Beike\Shop\Providers;
|
||||
|
||||
use Beike\Models\Customer;
|
||||
use Beike\Models\Setting;
|
||||
use Beike\Repositories\CategoryRepo;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Beike\Models\Customer;
|
||||
use Illuminate\Support\Str;
|
||||
use Beike\Repositories\CategoryRepo;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Beike\Shop\View\Components\AccountSidebar;
|
||||
|
||||
class ShopServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -29,6 +30,10 @@ class ShopServiceProvider extends ServiceProvider
|
|||
$this->app->booted(function () {
|
||||
$this->loadShareViewData();
|
||||
});
|
||||
|
||||
$this->loadViewComponentsAs('shop', [
|
||||
'sidebar' => AccountSidebar::class,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function loadSettings()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Beike\Shop\View\Components;
|
||||
|
||||
use Beike\Models\Customer;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class AccountSidebar extends Component
|
||||
{
|
||||
private $customer;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->customer = auth(Customer::AUTH_GUARD)->user();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return View|
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('components.account.sidebar', ['customer' => $this->customer]);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,11 @@
|
|||
</nav>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<span>x-shop-sidebar start</span>
|
||||
<x-shop-sidebar/>
|
||||
<span>x-shop-sidebar end</span>
|
||||
|
||||
<div class="col-12 col-md-3">
|
||||
<div class="account-sides-info">
|
||||
<div class="head">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<div>
|
||||
account sidebar
|
||||
{{ $customer->email }}
|
||||
<!-- When there is no desire, all things are at peace. - Laozi -->
|
||||
</div>
|
||||
Loading…
Reference in New Issue