@php use App\Models\Organization; @endphp @extends('layouts.main_layout') @section('title', $label) @section('icon-breadcrumbs',$icon) @section('content') {{ Breadcrumbs::render('info.organization') }}
Generate
@foreach ($org as $parent) @php $number = explode('.', $parent->number); $count = count($number); $colspan_body = $colspan - $count; @endphp @foreach ($number as $key => $c) @php $color = (($key + 1) == $count)? '' : ' text-muted'; @endphp @endforeach @php $orgchild = Organization::select('id', 'id_parent', 'id_structure', 'id_position', 'number', 'name', 'office', 'startyear', 'endyear', 'photo') ->with([ 'structure' => function($query) { $query->select('id', 'name'); }, 'position' => function($query) { $query->select('id', 'name'); }, 'attachment' ]) ->whereNotNull('id_parent') ->where('number', 'like', $parent->number . '.%') ->orderBy('number') ->get(); @endphp @foreach ($orgchild as $child) @php $number = explode('.', $child->number); $count = count($number); $colspan_body = $colspan - $count; @endphp @foreach ($number as $key => $c) @php $color = (($key + 1) == $count)? '' : ' text-muted'; @endphp @endforeach @endforeach @endforeach
# Nomor / Nama Bidang Posisi Periode Kantor Foto
{{ $c }}{{ $parent->name }} {{ $parent->structure->name }} {{ $parent->position->name }} {{ $parent->startyear . ' - ' . $parent->endyear }} {{ $parent->office }}
{{ $c }}{{ $child->name }} {{ $child->structure->name }} {{ $child->position->name }} {{ $child->startyear . ' - ' . $child->endyear }} {{ $child->office }}
{{ Form::open(array('url' => route('organization.store'), 'method' => 'post')) }} {{ Form::close() }} @endsection @push('scripts') @endpush