rename 'bezeichnung' field to 'description'
This commit is contained in:
parent
c54879c26e
commit
5f5101b977
3 changed files with 39 additions and 5 deletions
|
@ -20,7 +20,7 @@ class ItemController extends Controller
|
||||||
return response()->json(Item::where('eid','=',$eid)
|
return response()->json(Item::where('eid','=',$eid)
|
||||||
->join('containers','items.cid','=','containers.cid')
|
->join('containers','items.cid','=','containers.cid')
|
||||||
->leftJoin('files','items.iid','=','files.iid')
|
->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());
|
->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ class ItemController extends Controller
|
||||||
return response()->json(Item::where('eid','=',$eid)
|
return response()->json(Item::where('eid','=',$eid)
|
||||||
->join('containers','items.cid','=','containers.cid')
|
->join('containers','items.cid','=','containers.cid')
|
||||||
->leftJoin('files','items.iid','=','files.iid')
|
->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')
|
||||||
->where('items.bezeichnung', 'like' , '%'.base64_decode ( $query , true).'%')
|
->where('items.description', 'like' , '%'.base64_decode ( $query , true).'%')
|
||||||
->get());
|
->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,6 @@ class ItemController extends Controller
|
||||||
public function delete($event, $id)
|
public function delete($event, $id)
|
||||||
{
|
{
|
||||||
Item::findOrFail($id)->delete();
|
Item::findOrFail($id)->delete();
|
||||||
return response('Deleted Successfully', 200);
|
return response()->json(array("satus"=>'Deleted Successfully'), 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Item extends Model
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'iid', 'item_uid', 'bezeichnung', 'wann', 'wo', 'eid', 'cid'
|
'iid', 'item_uid', 'description', 'wann', 'wo', 'eid', 'cid'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
34
database/migrations/2019_12_15_203050_rename__itemfields.php
Normal file
34
database/migrations/2019_12_15_203050_rename__itemfields.php
Normal 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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue