I don't really know how this "status_human" works.
@raffelustig Neither do we. It’s something in your codebase. It’s nothing to do with Laravel.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
In our Laravel9 system for pistol competition we can list a table of competitions. If a competition will be open later then today for signups it will show: Anmälan öppnar 2022-06-15 as it does in Laravel 5.3. But in Laravel 9 it shows only: Anmälan öppnar. with no date. In the blade that shows this it looks like this:
<div class="table-responsive hidden-xs" ng-if="competitions.competitions.total">
<table class="table table-hover table-bordered table-striped ">
<thead>
<tr>
<th>Datum</th>
<th>Tävling</th>
<th>Status</th>
<th>Mästerskap</th>
<th>Typ av tävling</th>
<th>Ort/stad</th>
<th>Vapengrupper</th>
<th>Anmäld</th>
<th>Anmälningar</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ui-sref="competition.show({id: competition.id, view: 'information'})" ng-repeat="competition in competitions.competitions.data">
<td class="text-nowrap"><% competition.date %></td>
<td><% competition.name %></td>
<td><% competition.status_human %></td>
That statement is suppose to show something like this: https://imgur.com/MSBrS1g
<td><% (competition.championship.name) ? competition.championship.name : '-' %></td>
<td><% competition.competitiontype.name %></td>
<td><% competition.contact_city %></td>
<td><span ng-repeat="weapongroup in competition.weapongroups" class="label label-default margin-right-5 inline-block"><% weapongroup.name %></span></td>
<td>
<span ng-repeat="weaponclass in competition.weaponclasses">
<a ui-sref="signup({id: signup.id})" class="label label-primary margin-right-5" ng-repeat="signup in usersignups = (competition.usersignups | filter:{weaponclasses_id: weaponclass.id}: true)"><% (competition.championships_id) ? weaponclass.classname_general : weaponclass.classname %></a>
</span>
</td>
<td class="text-right">
<% competition.signups_count %>
</td>
<td><a ui-sref="competition.show({id: competition.id, view: 'information'})" class="btn btn-primary btn-xs">Visa</a></td>
</tr>
</tbody>
</table>
</div>
In the competition Model we have this:
protected $appends = [
'signups_count',
'patrols_count',
'teams_count',
'stations_count',
'results_count',
'status',
'status_human',
'start_time_human',
'final_time_human',
'allow_signups_after_closing_date_human',
'translations',
'results_type_human',
'available_logos',
'pdf_logo_path',
'pdf_logo_url',
];
and:
public function getStatusHumanAttribute(){
if($this->status == 'completed'):
return _('Avslutad (genomförd)');
elseif($this->status == 'stangd'):
return _('Stängd');
elseif($this->status == 'not_opened'):
return _('Anmälan öppnar');
elseif($this->status == 'closed'):
return _('Anmälan stängd');
elseif($this->status == 'after_signups_closing_date'):
return _('Efteranmälan');
else:
return _('Öppen för anmälan');
endif;
}
So I wonder how this can be corrected to work in Laravel 9. I don't really know how this "status_human" works.
The problem is solved by this:
return _('Anmälan öppnar');
is changed to:
return _("Anmälan öppnar $this->signups_opening_date");
So now it works fine. Thanks all for your help.
Please or to participate in this conversation.