|
|
|
@ -8,7 +8,7 @@ use App\Models\RequestMaterial;
|
|
|
|
|
use App\Models\Activity; |
|
|
|
|
use App\Models\ReportActivityMaterial; |
|
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
|
use Datatables; |
|
|
|
|
use Yajra\Datatables\Datatables; |
|
|
|
|
|
|
|
|
|
class AssignMaterialController extends Controller |
|
|
|
|
{ |
|
|
|
@ -47,10 +47,14 @@ class AssignMaterialController extends Controller
|
|
|
|
|
|
|
|
|
|
if ($planDate >= $startDate) { |
|
|
|
|
$result = AssignMaterial::create($data); |
|
|
|
|
if($result) { |
|
|
|
|
return response()->json(['status' => 'success', 'message' => 'Data added!', 'code' => 200], 200); |
|
|
|
|
} else { |
|
|
|
|
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 400], 400); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 400], 400); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function update(Request $request, $id) |
|
|
|
|