Merge branch 'trunk'
This commit is contained in:
commit
e1820ba1ac
3 changed files with 41 additions and 33 deletions
|
|
@ -259,7 +259,7 @@ class ProductsController extends Controller
|
|||
$rangeId = $request->range_id;
|
||||
$taxRateId = $request->tax_rate_id;
|
||||
|
||||
$this->checkSlugExistsWithinRange($rangeId, $slug, $product->id, $request);
|
||||
$this->checkSlugExistsWithinRange($request, $rangeId, $slug, $product->id);
|
||||
|
||||
$this->manageProductImages($request->picture, $product, $request->picture_large);
|
||||
|
||||
|
|
@ -310,13 +310,13 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Check if slug already exists, if so redirect
|
||||
*
|
||||
* @param integer $rangeId
|
||||
* @param string $slug
|
||||
* @param integer $productId
|
||||
* @param Request $request
|
||||
* @param Request $request
|
||||
* @param integer $rangeId
|
||||
* @param string $slug
|
||||
* @param integer|null $productId
|
||||
* @return \Illuminate\Http\RedirectResponse|void
|
||||
*/
|
||||
private function checkSlugExistsWithinRange(int $rangeId, string $slug, int $productId, Request $request)
|
||||
private function checkSlugExistsWithinRange(Request $request, int $rangeId, string $slug, int $productId = null)
|
||||
{
|
||||
// Check si le slug existe déjà dans cette gamme de produits.
|
||||
$slugExist = Product::where([
|
||||
|
|
@ -409,11 +409,11 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* sync tags to product
|
||||
*
|
||||
* @param array $tags
|
||||
* @param Product $product
|
||||
* @param array|null $tags
|
||||
* @param Product $product
|
||||
* @return void
|
||||
*/
|
||||
private function syncTags(array $tags, Product &$product)
|
||||
private function syncTags(array $tags = null, Product &$product)
|
||||
{
|
||||
if (!empty($tags)) {
|
||||
$arTagIds = array();
|
||||
|
|
@ -436,11 +436,11 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* sync associated products to product
|
||||
*
|
||||
* @param string $prods
|
||||
* @param Product $product
|
||||
* @param string|null $prods
|
||||
* @param Product $product
|
||||
* @return void
|
||||
*/
|
||||
private function syncProduitsAssocies(string $prods, Product $product)
|
||||
private function syncProduitsAssocies(string $prods = null, Product $product)
|
||||
{
|
||||
if (!empty($prods)) {
|
||||
$productIds = explode(",", $prods);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class RegisterConfirmMail extends Mailable implements ShouldQueue
|
|||
* @param string|null $firstname
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Customers $customer, mixed $firstname)
|
||||
public function __construct(Customers $customer, string $firstname = null)
|
||||
{
|
||||
$this->firstname = $firstname;
|
||||
$this->customer = $customer;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use Illuminate\Support\Facades\View;
|
|||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
|
|
@ -38,29 +39,36 @@ class AppServiceProvider extends ServiceProvider
|
|||
setlocale(LC_TIME, strtoupper(config('app.locale')) . "_" . config('app.locale') . '.utf8');
|
||||
}
|
||||
|
||||
config([
|
||||
'bosettings' => Setting::all()
|
||||
->keyBy('key')
|
||||
// Key every setting by its name.
|
||||
->transform(function ($setting) {
|
||||
return $setting->value;
|
||||
// Return only the value.
|
||||
})
|
||||
->toArray()
|
||||
// Make it an array.
|
||||
]);
|
||||
if (Schema::hasTable('settings')) {
|
||||
// The "settings" table exists...
|
||||
config([
|
||||
'bosettings' => Setting::all()
|
||||
->keyBy('key')
|
||||
// Key every setting by its name.
|
||||
->transform(function ($setting) {
|
||||
return $setting->value;
|
||||
// Return only the value.
|
||||
})
|
||||
->toArray()
|
||||
// Make it an array.
|
||||
]);
|
||||
|
||||
// On partage les ranges (gammes produit).
|
||||
$ranges = Range::where('status', '1')->get();
|
||||
View::share('published_ranges', $ranges);
|
||||
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
|
||||
// Front theme settings.
|
||||
View::share('front_settings', $front_settings);
|
||||
}
|
||||
|
||||
// On partage les tags.
|
||||
$tags = Tag::where('status', '1')->orderBy('order', 'ASC')->get();
|
||||
View::share('published_tags', $tags);
|
||||
if (Schema::hasTable('ranges')) {
|
||||
// On partage les ranges (gammes produit).
|
||||
$ranges = Range::where('status', '1')->get();
|
||||
View::share('published_ranges', $ranges);
|
||||
}
|
||||
|
||||
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
|
||||
// Front theme settings.
|
||||
View::share('front_settings', $front_settings);
|
||||
if (Schema::hasTable('tags')) {
|
||||
// On partage les tags.
|
||||
$tags = Tag::where('status', '1')->orderBy('order', 'ASC')->get();
|
||||
View::share('published_tags', $tags);
|
||||
}
|
||||
|
||||
Blade::directive('fmt_currency', function ($expression) {
|
||||
return "<?php
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue