Am trying to display all the data on the admin end but i have failed. How
can i display it?
This is the method that i want to display all the data(Workflows):
public function getUserWorkflows(){
$user = $this->userRepo->users();
$active_module = AppConstants::$ACTIVE_MOD_USERS;
$appraisals = Appraisal::with(
['academicBackgrounds','keyDuties','additionalAssignments',
'competences','workflow', 'assignments','keyDuties'] )->
where('user_id','=',$user->id)->orderBy('created_at','desc')->get();
$summaries = DataGenerator::getAppraisalSummaries($appraisals);
$user = User::with(['department'])->find($user->id);
$appraisalsAssigned = DataGenerator::getAssingedAppraisals($user->id);
$assignedSummaries = DataGenerator::getAppraisalSummaries($appraisalsAssigned);
return view('user.tasks',compact('appraisals','users','active_module','summaries','appraisalsAssigned','assignedSummaries'));
}
Below is the code snippet from the view where i want the data to displayed. But it has totally failed to display. Because i think there is something that am not getting right:
<div class="col s12">
<div class="col s12">
<ul id="issues-collection" class="collection">
<li class="collection-item avatar">
<i class="material-icons circle blue darken-4">folder</i>
<span class="collection-header">Workflow</span>
</li>
@if(isset($appraisals) && count($appraisals) > 0)
@foreach($appraisals as $appraisal)
@if($loop->iteration <= 3)
<li class="collection-item">
<div class="row row-custom-modal-footer collections-title">
<div class="col s12"><strong>. </strong>
</div>
</div>
<div class="row row-custom-modal-footer valign-wrapper">
<div class="col s3"><p>Date: <span class="text-primary"></span></p></div>
<div class="col s5">
<span class="task-cat blue-stepper">
@if(isset($summaries))
@foreach($summaries as $summary)
@if($summary['id'] == $appraisal->id)
@endif
@endforeach
@endif
</span>
</div>
<div class="col s2">
<div class="progress">
<div class="determinate blue darken-4"
@if(isset($summaries))
@foreach($summaries as $summary)
@if($summary['id'] == $appraisal->id)
style="width: ;"
@endif
@endforeach
@endif></div>
</div>
</div>
<div class="col s1">
<p class=" camel-case"><a class="text-primary bold-text" href="">View</a></p>
</div>
<div class="col s1">
<p class=" camel-case"><a class="text-primary bold-text" href="">Stop Workflow</a></p>
</div>
</div>
</li>
@endif
@endforeach
<li class="collection-item">
<div class="row">
<div class="col s12 spacer-top">
<a href="#">View all your tasks</a>
</div>
</div>
</li>
@else
<li class="collection-item">
<div class="col s12 bold-text">
<p>There are no pending tasks</p>
</div>
</li>
@endif
</ul>
</div>
</div>
I want when the person logs in as an admin, they are able to see all the data from the database once they access the view. But it only displays the data when the person logs in as a user.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2wxgO82
via IFTTT
Aucun commentaire:
Enregistrer un commentaire