Skip to content

Commit

Permalink
Remove 'device_key' from equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
rjackson committed Jun 9, 2024
1 parent 687295b commit 4f84e6e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
2 changes: 0 additions & 2 deletions app/Entities/Equipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @property Carbon $obtained_at
* @property Carbon $removed_at
* @property integer $usageCost
* @property string $device_key
* @property string $induction_category
* @package BB\Entities
*/
Expand All @@ -44,7 +43,6 @@ class Equipment extends Model
'room',
'detail',
'slug',
'device_key',
'description',
'help_text',
'managing_role_id',
Expand Down
1 change: 0 additions & 1 deletion app/Http/Requests/Equipment/StoreEquipmentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function rules()
'room' => 'required',
'detail' => '',
'slug' => 'required|alpha_dash|unique:equipment,slug',
'device_key' => '',
'description' => '',
'help_text' => '',
'managing_role_id' => 'exists:roles,id',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class RemoveDeviceKeyFromEquipment extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('equipment', function (Blueprint $table) {
$table->dropColumn('device_key');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('equipment', function (Blueprint $table) {
$table->string('device_key', 20)->nullable();
});
}
}
15 changes: 0 additions & 15 deletions resources/views/equipment/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,6 @@
</div>
</div>

<div class="form-group {{ $errors->has('device_key') ? 'has-error' : '' }}">
{!! Form::label('device_key', 'Device Key', ['class'=>'col-sm-3 control-label']) !!}
<div class="col-sm-9 col-lg-7">
{!! Form::text('device_key', null, ['class'=>'form-control']) !!}
<p class="help-block">The id of a ACS device already setup in the database</p>
@if($errors->has('device_key'))
<span class="help-block">
@foreach($errors->get('device_key') as $error)
<li>{{ $error }}</li>
@endforeach
</span>
@endif
</div>
</div>

{{-- Allow anybody to set on creation, but only admins/trainers to edit --}}
<div class="form-group {{ $errors->has('obtained_at') ? 'has-error' : '' }}">
{!! Form::label('obtained_at', 'Date Obtained', ['class'=>'col-sm-3 control-label']) !!}
Expand Down

0 comments on commit 4f84e6e

Please sign in to comment.