diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 03014d4..adb3108 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -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); } } diff --git a/app/Item.php b/app/Item.php index 8c619b3..25760d7 100644 --- a/app/Item.php +++ b/app/Item.php @@ -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' ]; diff --git a/database/migrations/2019_12_15_203050_rename__itemfields.php b/database/migrations/2019_12_15_203050_rename__itemfields.php new file mode 100644 index 0000000..202cab0 --- /dev/null +++ b/database/migrations/2019_12_15_203050_rename__itemfields.php @@ -0,0 +1,34 @@ +renameColumn('bezeichnung','description'); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('items', function (Blueprint $table) { + $table->renameColumn('description', 'bezeichnung'); + }); + } +}