rename 'bezeichnung' field to 'description'

This commit is contained in:
j3d1 2019-12-15 20:34:47 +01:00
parent c54879c26e
commit 5f5101b977
3 changed files with 39 additions and 5 deletions

View file

@ -20,7 +20,7 @@ class ItemController extends Controller
return response()->json(Item::where('eid','=',$eid)
->join('containers','items.cid','=','containers.cid')
->leftJoin('files','items.iid','=','files.iid')
->select('items.*','files.hash as file', 'containers.name as container')
->select('items.*','files.hash as file', 'containers.name as box')
->get());
}
@ -30,8 +30,8 @@ class ItemController extends Controller
return response()->json(Item::where('eid','=',$eid)
->join('containers','items.cid','=','containers.cid')
->leftJoin('files','items.iid','=','files.iid')
->select('items.*','files.hash as file', 'containers.name as container')
->where('items.bezeichnung', 'like' , '%'.base64_decode ( $query , true).'%')
->select('items.*','files.hash as file', 'containers.name as box')
->where('items.description', 'like' , '%'.base64_decode ( $query , true).'%')
->get());
}
@ -57,6 +57,6 @@ class ItemController extends Controller
public function delete($event, $id)
{
Item::findOrFail($id)->delete();
return response('Deleted Successfully', 200);
return response()->json(array("satus"=>'Deleted Successfully'), 200);
}
}

View file

@ -15,7 +15,7 @@ class Item extends Model
* @var array
*/
protected $fillable = [
'iid', 'item_uid', 'bezeichnung', 'wann', 'wo', 'eid', 'cid'
'iid', 'item_uid', 'description', 'wann', 'wo', 'eid', 'cid'
];

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RenameItemfields extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('items', function (Blueprint $table) {
$table->renameColumn('bezeichnung','description');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('items', function (Blueprint $table) {
$table->renameColumn('description', 'bezeichnung');
});
}
}