This commit is contained in:
Ludovic CANDELLIER
2022-04-24 22:07:31 +02:00
parent e4672a42d7
commit 5d68e8787a
11 changed files with 147 additions and 45 deletions

View File

@@ -18,6 +18,7 @@ use App\Repositories\Partners;
use App\Repositories\Core\Upload;
use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules;
class Users
{
use LaratrustUserTrait;

View File

@@ -2,10 +2,40 @@
namespace App\Repositories\Shop;
use Illuminate\Support\Facades\Auth;
use App\Models\Shop\Customer;
class Customers
{
public static function getAvatar()
{
}
public static function getName()
{
$user = self::getAuth();
return $user ? $user->first_name : '';
}
public static function getAuth()
{
return Auth::guard('customer')->user();
}
public static function getId()
{
return Auth::guard('customer')->id();
}
public static function isConnected()
{
return Auth::guard('customer')->check();
}
public static function getOptions()
{
return Customer::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();

View File

@@ -40,7 +40,7 @@ class Offers
{
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
$offer = Offer::withPriceBySaleChannelByQuantity($sale_channel_id, $quantity)->find($id);
return number_format($offer->price_lists->first()->price_list_values->first(),2);
return $offer->price_lists->first()->price_list_values->first();
}
public static function getBasket()