TMP : Ticket 1192
11
app/Models/PoultryPackshot.php
Normal 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;
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.6 MiB |
|
After Width: | Height: | Size: 3.3 MiB |
|
After Width: | Height: | Size: 3.6 MiB |
|
After Width: | Height: | Size: 2.9 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 2.9 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 3.6 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3 MiB |
|
After Width: | Height: | Size: 2.9 MiB |
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.4 MiB |
|
After Width: | Height: | Size: 3.4 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 9.6 MiB |
|
|
@ -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">
|
||||
|
|
|
|||