Skip to content

Add assigned_to username to label #10228

Answered by MonkeyNPC
BertCurbit asked this question in Q&A
Discussion options

You must be logged in to vote

This is how I have mine set up in */resources/views/hardware/labels.blade.php:

Under <div class="qr_text!='')

add:

 @if (($asset->assigned_to!=' ') && ($asset->assigned_type=='App\Models\User'))

		<div class="pull-left">

		    Assigned To: {{ $asset->assignedto->first_name }} {{ $asset->assignedto->last_name }}

		</div>
@endif 

Where ever you would like the Assigned to user to appear. It will write it as "First Name Last Name" on the label.
Example: "Assigned To: John Smith" You can change the "Assigned To:" at the beginning to be Checked Out To: or any other option including removing that part completely. You can also add html before and after such as
<b><u>Assigned To:</u></b>

I'm …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@MonkeyNPC
Comment options

Answer selected by BertCurbit
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants