|
|
|
@ -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,7 +47,11 @@ class AssignMaterialController extends Controller
|
|
|
|
|
|
|
|
|
|
if ($planDate >= $startDate) { |
|
|
|
|
$result = AssignMaterial::create($data); |
|
|
|
|
return response()->json(['status' => 'success', 'message' => 'Data added!', 'code' => 200], 200); |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|