Compare commits

..

3 Commits

@ -73,6 +73,15 @@ php artisan seeding:image Product digital
```
</div>
یا برای همه مدل‌ها یک‌جا از دستور زیر استفاده کنید:
<div dir="ltr">
```bash
php artisan seeding:all digital
```
</div>
> شما ابتدا باید مدل را نوشته و سپس فولدر مورد نظر برای تصاویر را وارد کنید[bag, clothe, digital, sport, posts, makeup]
> همچنین می‌توانید یک پوشه درخواه پر از تصاویر jpg دلخواه را در آن پر کنید

@ -55,9 +55,17 @@ php artisan seeding:prepare
```
- nor copy your image folder to `database/seeders/images/`
- then: Seeding image for models: [Group, Category, Post, Product, Slider]
```bash
php artisan seeding:image Product digital
```
Or to seed all models:
```bash
php artisan seeding:all digital
```
> First parameter is Model, Second is image seeder directory available [bag, clothe, digital, sport, posts, makeup]
> You can create your directory and put your image into new directory then use image seeder

@ -0,0 +1,48 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SeedImageAll extends Command
{
public $models = ['Category', 'Group', 'Slider', 'Post', 'Product'];
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'seeding:all {directory}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
//
foreach ($this->models as $model) {
// Call the seeder command
$exitCode = \Artisan::call('seeding:image', ['directory' => $this->argument('directory'), 'model' => $model]);
// Get the output
$output = \Artisan::output();
// Handle the exit code and output as needed
if ($exitCode === 0) {
$this->info( "Seeding was successful: [$model] \n");
} else {
$this->error("Seeding failed with exit code {$exitCode}:\n");
}
$this->info( $output);
}
}
}

@ -225,6 +225,7 @@ class AreaController extends Controller
public function build(){
$exitCode = \Artisan::call('client');
$exitCode = \Artisan::call('build');
// Get the command output from cache

@ -343,6 +343,7 @@
"Needs Improvement": "نیازمند بهینه‌تر شدن",
"Next": "بعدی",
"No parent": "بدون والد",
"Not available": "نا موجود",
"Not required": "غیر ضرروری",
"Order removed successfully": "سفارش با موفقیت حذف شد",
"Orders": "سفارشاات",

@ -71,6 +71,8 @@
</p>
</div>
<div class="mt-4">&nbsp;</div>
@if($product->stock_status == 'IN_STOCK')
@if($product->quantities()->count()>0)
<quantities-add-to-card
:qz='@json($product->quantities)'
@ -89,6 +91,14 @@
{{__("Add to card")}}
</a>
@endif
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
<div class="mt-4">&nbsp;</div>
@if($product->sku != null && $product->sku != '')
<div class="aria-product-data">

@ -111,6 +111,8 @@
</a>
<div class="mt-1">&nbsp;</div>
@if($product->stock_status == 'IN_STOCK')
@if($product->quantities()->count()>0)
<quantities-add-to-card
:qz='@json($product->quantities)'
@ -129,6 +131,14 @@
{{__("Add to card")}}
</a>
@endif
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
</div>
</div>
<div class="navtabs">

@ -49,6 +49,8 @@
@endif
</div>
<br>
@if($product->stock_status == 'IN_STOCK')
@if($product->quantities()->count()>0)
<quantities-add-to-card
:qz='@json($product->quantities)'
@ -61,13 +63,19 @@
@endif
></quantities-add-to-card>
@else
<div class="text-center">
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-outline-primary add-to-card btn-lg">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
</div>
@endif
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
<h4>
{{__("Description")}}

@ -27,11 +27,19 @@
</span>
</div>
<div class="p-2">
@if($product->stock_status == 'IN_STOCK')
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-outline-primary w-100 add-to-card">
class="btn btn-primary add-to-card">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
</div>
</a>
</div>

@ -4,11 +4,19 @@
<img src="{{$product->thumbUrl2()}}" class="img-2" alt="{{$product->name}}" loading="lazy">
<div class="">
<div class="btns">
@if($product->stock_status == 'IN_STOCK')
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-primary add-to-card">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
<a class="btn btn-outline-dark compare-btn text-dark" data-slug="{{$product->slug}}"
data-bs-custom-class="custom-tooltip"
data-bs-toggle="tooltip" data-bs-placement="top"

@ -27,11 +27,19 @@
</span>
</div>
<div class="p-2">
@if($product->stock_status == 'IN_STOCK')
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-outline-primary w-100 add-to-card">
class="btn btn-primary add-to-card">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
@else
<a
class="btn btn-primary disabled">
<i class="ri-shopping-bag-3-line"></i>
{{__("Not available")}}
</a>
@endif
</div>
</a>
</section>

Loading…
Cancel
Save