TMP : Ticket 1192

This commit is contained in:
Vincent BRIDIER 2022-11-23 16:12:07 +01:00
parent ab9cee6303
commit 13f7e2ee02
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
38 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PoultryPackshot extends Model
{
use HasFactory;
}

View file

@ -210,4 +210,14 @@ class TraceaPoultry extends Model
}
return true;
}
/**
* Get Packshot
*
* @return \App\Models\PoultryPackshot|null
*/
public function getPackshotAttribute(): ?PoultryPackshot
{
return PoultryPackshot::whereItemCode($this->item_code)->first();
}
}

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePoultryPackshotsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('poultry_packshots', function (Blueprint $table) {
$table->id();
$table->string('item_code', 14)->comment("Item Code = tracea_poultries.item_code");
$table->string('ean', 13)->comment("Ean 13");
$table->string('packshot_name')->comment("Packshot picture name");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('poultry_packshots');
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 MiB

View file

@ -14,7 +14,14 @@
@include('front.modules.flashMessage')
<div class="row justify-content-center">
<div class="col mt-5 px-5 py-3 content-max-width text-center">
@php
$packshot = $traceaPoultry->packshot;
@endphp
@if(!is_null($packshot))
<img src="{{ asset('assets/images/poultry_packshots/' . $packshot->packshot_name) }}" alt="{{ __('Poulet emballé et labelisé') }}" class="img-fluid">
@else
<img src="{{ asset('assets/images/tracea/poultry/poulet.png') }}" alt="{{ __('Poulet emballé et labelisé') }}" class="img-fluid">
@endif
</div>
</div>
<div class="row justify-content-center pb-5">