Browse Source

type gantt

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
72fcd472ac
  1. 7
      app/Http/Controllers/VersionGanttController.php
  2. 10
      app/Models/VersionGantt.php

7
app/Http/Controllers/VersionGanttController.php

@ -6,11 +6,10 @@ use Illuminate\Http\Request;
use App\Models\VersionGantt; use App\Models\VersionGantt;
class VersionGanttController extends Controller class VersionGanttController extends Controller
{ {
public function add(Request $request){ public function add(Request $request){
$this->validate($request, [ $this->validate($request, [
'name_version' => 'required', 'name_version' => 'required',
'description' => 'required',
'proyek_id' => 'required' 'proyek_id' => 'required'
]); ]);
$data = $request->all(); $data = $request->all();
@ -36,7 +35,7 @@ class VersionGanttController extends Controller
return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400);
die(); die();
} }
if($result){ if($result){
return response()->json(['status'=>'success','message'=>'version gantt Project successfully updated!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'version gantt Project successfully updated!','code'=>200], 200);
}else{ }else{
@ -54,7 +53,7 @@ class VersionGanttController extends Controller
return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400);
die(); die();
} }
if($delete){ if($delete){
return response()->json(['status'=>'success','message'=>'version gantt Project successfully deleted!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'version gantt Project successfully deleted!','code'=>200], 200);

10
app/Models/VersionGantt.php

@ -12,14 +12,16 @@ class VersionGantt extends Model
const UPDATED_AT = 'updated_at'; const UPDATED_AT = 'updated_at';
protected $fillable = [ protected $fillable = [
'name_version', 'name_version',
'description', 'description',
'date_base_line', 'date_base_line',
'proyek_id', 'proyek_id',
'config_dayoff', 'config_dayoff',
'created_at', 'auto_schedule',
'created_by', 'calculation_type',
'updated_at', 'created_at',
'created_by',
'updated_at',
'updated_by' 'updated_by'
]; ];
} }

Loading…
Cancel
Save