Skip to content

Commit

Permalink
Update: Laravel Modules. enabled is now isEnabled.
Browse files Browse the repository at this point in the history
Update: Laravel Modules. $module->name now is protected, use $module->getName()
  • Loading branch information
imagina committed Nov 5, 2020
1 parent c53871c commit e41f382
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
</thead>
<tbody>
<?php if (isset($modules)): ?>

<?php foreach ($modules as $module): ?>

<tr>
<td>
<a href="{{ route('admin.workshop.modules.show', [$module->getLowerName()]) }}">
{{ $module->name }}
{{ $module->getName() }}
</a>
</td>
<td>
Expand All @@ -50,8 +52,8 @@
</td>
<td>
<a href="{{ route('admin.workshop.modules.show', [$module->getLowerName()]) }}">
<span class="label label-{{$module->enabled() ? 'success' : 'danger'}}">
{{ $module->enabled() ? trans('workshop::modules.enabled') : trans('workshop::modules.disabled') }}
<span class="label label-{{$module->isEnabled() ? 'success' : 'danger'}}">
{{ $module->isEnabled() ? trans('workshop::modules.enabled') : trans('workshop::modules.disabled') }}
</span>
</a>
</td>
Expand Down
10 changes: 5 additions & 5 deletions Modules/Workshop/Resources/views/admin/modules/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<i class="fa fa-reply"></i>
</a>
</small>
{{ $module->name }} <small>{{ trans('workshop::modules.module') }}</small>
{{ $module->getName() }} <small>{{ trans('workshop::modules.module') }}</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('user::users.breadcrumb.home') }}</a></li>
<li><a href="{{ route('admin.workshop.modules.index') }}">{{ trans('workshop::modules.breadcrumb.modules') }}</a></li>
<li class="active">{{ trans('workshop::modules.viewing module') }} {{ $module->name }}</li>
<li class="active">{{ trans('workshop::modules.viewing module') }} {{ $module->getName() }}</li>
</ol>
@stop

Expand Down Expand Up @@ -48,17 +48,17 @@
<div class="box box-primary">
<div class="box-header">
<div class="box-tools pull-right">
<?php $status = $module->enabled() ? 'disable' : 'enable'; ?>
<?php $status = $module->isEnabled() ? 'disable' : 'enable'; ?>
<button class="btn btn-box-tool jsPublishAssets" data-toggle="tooltip"
title="" data-original-title="{{ trans("workshop::modules.publish assets") }}">
<i class="fa fa-cloud-upload"></i>
{{ trans("workshop::modules.publish assets") }}
</button>
<?php $routeName = $module->enabled() ? 'disable' : 'enable' ?>
<?php $routeName = $module->isEnabled() ? 'disable' : 'enable' ?>
{!! Form::open(['route' => ["admin.workshop.modules.$routeName", $module->getName()], 'method' => 'post']) !!}
<button class="btn btn-box-tool" data-toggle="tooltip" type="submit"
title="" data-original-title="{{ trans("workshop::modules.{$status}") }}">
<i class="fa fa-toggle-{{ $module->enabled() ? 'on' : 'off' }}"></i>
<i class="fa fa-toggle-{{ $module->isEnabled() ? 'on' : 'off' }}"></i>
{{ trans("workshop::modules.{$status}") }}
</button>
{!! Form::close() !!}
Expand Down

0 comments on commit e41f382

Please sign in to comment.