Lager-v3/resources/views/models/show.blade.php

52 lines
2.0 KiB
PHP

@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
<div class="row">
<div class="col-auto">
<h1>@lang('model') {{$data->name}}</h1>
</div>
@can('models_edit')
<div class="col">
<a href="{{route('models.edit',['model' => $data])}}"
class="btn btn-outline-success ms-4 mt-2">
@lang('edit')
</a>
</div>
@endcan
</div>
<h2>
@lang('brand') :
@can('brands_view')
<a href="{{route('brands.show',['brand' => $data->brand])}}" target="_blank"
class="btn btn-success">
{{$data->brand->name}}
</a>
@endcan
</h2>
<h2>@lang('products')</h2>
@if(count($data->products) >= 1)
<table>
@foreach($data->products as $product)
<tr>
<td>
<a href="{{route('products.show',['product' => $product])}}" class="btn btn-success" target="_blank">
@if(config('app.barcode_mode') == 'dynamic')
{{$product->category->name}}.@if(!empty($product->subcategory->name)){{$product->subcategory->name}}.@endif{{$product->brand->name}}.{{$product->model->name}}@if(!empty($product->name)).{{$product->name}}@endif
@endif
@if(config('app.barcode_mode') == 'static')
{{$tracked->loanable->barcode}}
@endif
</a> </td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('products')
@endif
</div>
@endsection
@section('scripting')
@endsection