Add variations, slider, fix cart ...

This commit is contained in:
Ludovic CANDELLIER
2022-03-21 21:52:12 +01:00
parent 0eaa11b2a9
commit ddc5f2664c
27 changed files with 438 additions and 81 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Shop\Category;
class untranslateShelves extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'untranslateShelves';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrations of shelves';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$categories = Category::all();
foreach ($categories as $category) {
$trans = json_decode($category->name, true);
$name = $trans['fr'];
$trans = $category->description ? json_decode($category->description, true) : false;
$description = $trans ? $trans['fr'] : '';
$category->update(['name' => $name, 'description' => $description]);
}
}
}