I want to display these elements:
$category->getFullNameAttribute()
$category->id
$category->email
$category->image
Here is my view:
<div class="col-md-12">
<div class="card" style="padding: 20px; overflow: auto;">
<ul id="ul-data" style="display:none;">
@foreach ($categories as $category)
<li class="user-{{ $category->id }}">
{{ $category->getFullNameAttribute() }}
{{ $category->id }}
{{ $category->email }}
{{ $category->image }}
{{-- {{$category->representative}} --}}
@if (count($category->childes))
@include('management.orgchart.manageChild',['childs' => $category->childes])
@endif
</li>
@endforeach
</ul>
<div id="chart-container"></div>
However, when I display them in this way they are all going into the same div title or text.
I am getting big problems because I need it separate into more div because I want to display email at the bottom, the name at the top, id next to image and various other styling choices.
Does anyone know how I can put elements (id, email, image...) into different variables so I can easily manipulate them.
I appreciate your help and I will do everything to fix issues.
If I didn't explain something properly please ask me in comments and I will try my best to explain it in more detail.
Edit: This is controller for that method:
<?php
namespace App\Http\Controllers;
use App\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Session;
class OrgController extends Controller
{
/**
* Display the OrgChart.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
Carbon::setLocale(App::getLocale());
if (Session::get('locked') === true) {
return redirect('/lock');
}
$categories = User::where('supervisor_id', '=', null)->get();
return view('management.orgchart.index', compact('categories'));
}
}
This is the model window which appears when pressing the right title of the names.
I want to put data into this div (first name, last name, email etc...):
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Profile Window</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="text-center">
<div class="img-container">
<img src="img/default-avatar.png" class="img-circle" id="circleImage" alt="Cinque Terre" />
</div>
</div>
<div class="text-center">
<div id="first_name" style="display: inline-block;">First name</div> <br>
<div id="last_name" style="display: inline-block;">Last name</div>
<div id="birthday">00.10.2020</div>
<div id="customer_email">hello@k-tronik.de</div>
<div id="representative_id">Representive Person</div>
<br>
</div>
<p id="contentWin">
{{-- @foreach($categories as $category)
<li class="user-{{ $user->id }}">
{{ $user->getId }}
@if (count($user->childes))
@include('management.orgchart.manageChild',['childs' => $category->childes])
@endif
</li>
@endforeach --}}
Using dummy content or fake information in the Web design process can result in products with unrealistic assumptions and potentially serious design flaws. A seemingly elegant design can quickly begin to bloat with unexpected content or break under the weight of actual activity. Fake data can ensure a nice looking layout but it doesn’t reflect what a
Lorem Ipsum actually is usefull in the design stage as it
Kyle Fiedler from the Design Informer feels that distracting copy is your fault:
If the copy becomes distracting in the design then you are doquestions about lorem ipsum don’t.
Summing up, if the copy is diverting attention from the design it’s because it’s not up to task.
Typographers of yore didn't come up with the concept ot on it. They will be drawn to it, fiercely. Do it the wrong way and draft copy can derail your design review.
Asking the client to pay no attention Lorem Ipsum ing you can't win. Whenever draft copy comes up in a meeting confused questions about it ensue.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
{{--<button type="button" class="btn btn-primary">Save changes</button>--}}
</div>
</div>
</div>
</div>
This might help you,
<div class="col-md-12">
<div class="card" style="padding: 20px; overflow: auto;">
<ul id="ul-data" style="display:none;">
@foreach($categories as $category)
<li class="user-{{ $category->id }}">
<span class="getFullNameAttribute">
{{ $category->getFullNameAttribute()}}
</span>
<span class="id">
{{ $category->id}}
</span>
<span class="email">
{{$category->email}}
</span>
<span class="image">
{{$category->image}}
</span>
<span class="representative">
{{--{{$category->representative}}--}}
</span>
@if(count($category->childes))
@include('management.orgchart.manageChild',['childs' => $category->childes])
@endif
</li>
@endforeach
</ul>
<div id="chart-container"></div>
</div>
You can change markup according to your needs, and if you want to assign single category variable to other variable you can do this,
@php
$your_variable = $category;
@endphp