Merge pull request #61 from Ritikeshyadav/HritikFreeu

Hritik freeu
This commit is contained in:
Hritikkk9
2024-04-12 15:15:44 +05:30
committed by GitHub
21 changed files with 236 additions and 41 deletions

View File

@@ -756,11 +756,11 @@ class AuthController extends Controller
if ($isOtpVerificationFor == 1) {
$emailOtp = $request->email_otp;
$emailToAdd = $request->email2;
$userEmailOtpData = UserOtp::where('email', $emailToAdd)->where('otp', $emailOtp)->first(); // checking user email otp data
// dd($userEmailOtpData);
if (!$userEmailOtpData) {
return response()->json(['status' => 400, 'message' => 'Email OTP Did Not Matched!'], 400);
}
@@ -776,6 +776,7 @@ class AuthController extends Controller
$contactToAdd = $request->contact_number2;
$userContactOtpData = UserOtp::where('contact_number', $contactToAdd)->where('contact_otp', $contactOtp)->first();
if (!$userContactOtpData) {
return response()->json(['status' => 400, 'message' => 'Contact OTP Did Not Matched!'], 400);
}
@@ -783,7 +784,6 @@ class AuthController extends Controller
return response()->json(['status' => 400, 'message' => 'OTP has been expired!'], 400);
}
$userCreated = User::create([
'name' => $request->name2,
'user_type' => 'Asset Manager',

View File

@@ -70,7 +70,7 @@ class FractionalRealEstateController extends Controller
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 400);
}
}
}
public function fractionalRealEstateData($slug)
{

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class AngelFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class AngelFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'fund_name' => $this->fund_name,

View File

@@ -5,6 +5,8 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class CleanAndGreenAssetsResource extends JsonResource
{
/**
@@ -16,9 +18,19 @@ class CleanAndGreenAssetsResource extends JsonResource
public function toArray($request)
{
$products = Product::find($this->products_id);
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => $products->presentation ?? null,
'fact_sheet' => $products->fact_sheet ?? null,
'project_name' => $this->project_name,

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class DebtFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class DebtFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'fund_name' => $this->fund_name,

View File

@@ -3,6 +3,7 @@
namespace App\Http\Resources;
use App\Models\Product;
use App\Models\ProductImage;
use Illuminate\Http\Resources\Json\JsonResource;
class FractionalRealEstateResource extends JsonResource
@@ -15,32 +16,42 @@ class FractionalRealEstateResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'companies_id' => $this->companies_id,
'slug' => $this->slug,
'property_name_and_location' => $this->property_name_and_location,
'property_description' => $this->property_description,
'property_grade' => $this->property_grade,
'asset_type' => $this->asset_type,
'tenant' => $this->tenant,
'deal_size_in_crore' => $this->deal_size_in_crore,
'coupon_rate_on_ccd' => $this->coupon_rate_on_ccd,
'rental_escalation' => $this->rental_escalation,
'capital_appreciation' => $this->capital_appreciation,
'expected_irr' => $this->expected_irr,
'cagr' => $this->cagr,
'minimum_investment' => $this->minimum_investment,
'minimum_investment_lockin' => $this->minimum_investment_lockin,
'tenant_lease_term' => $this->tenant_lease_term,
'tenant_lock_in' => $this->tenant_lock_in,
'tenant_security_deposit' => $this->tenant_security_deposit,
'annual_management_fee' => $this->annual_management_fee,
'performance_fees' => $this->performance_fees,
'hurdle_rate' => $this->hurdle_rate,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'companies_id' => $this->companies_id,
'slug' => $this->slug,
'property_name_and_location' => $this->property_name_and_location,
'property_description' => $this->property_description,
'property_grade' => $this->property_grade,
'asset_type' => $this->asset_type,
'tenant' => $this->tenant,
'deal_size_in_crore' => $this->deal_size_in_crore,
'coupon_rate_on_ccd' => $this->coupon_rate_on_ccd,
'rental_escalation' => $this->rental_escalation,
'capital_appreciation' => $this->capital_appreciation,
'expected_irr' => $this->expected_irr,
'cagr' => $this->cagr,
'minimum_investment' => $this->minimum_investment,
'minimum_investment_lockin' => $this->minimum_investment_lockin,
'tenant_lease_term' => $this->tenant_lease_term,
'tenant_lock_in' => $this->tenant_lock_in,
'tenant_security_deposit' => $this->tenant_security_deposit,
'annual_management_fee' => $this->annual_management_fee,
'performance_fees' => $this->performance_fees,
'hurdle_rate' => $this->hurdle_rate,
];
}
}

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class FundForDistressedAssetResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class FundForDistressedAssetResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'fund_name' => $this->fund_name,

View File

@@ -4,6 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class HedgeFundResource extends JsonResource
{
@@ -15,9 +16,19 @@ class HedgeFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'fund_name' => $this->fund_name,

View File

@@ -5,6 +5,9 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class HighYieldFinanceResource extends JsonResource
{
/**
@@ -15,10 +18,20 @@ class HighYieldFinanceResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
// return parent::toArray($request);
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'slug' => $this->slug,

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class InfrastructureFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class InfrastructureFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id) == null ? null : Product::find($this->products_id)->value('fact_sheet'),
'fund_name' => $this->fund_name ?? '',

View File

@@ -3,6 +3,8 @@
namespace App\Http\Resources;
use App\Models\Product;
use App\Models\ProductImage;
use Illuminate\Http\Resources\Json\JsonResource;
class InvoiceDiscountingResource extends JsonResource
@@ -15,9 +17,19 @@ class InvoiceDiscountingResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'company_name' => $this->company_name,

View File

@@ -5,6 +5,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class LeaseBasedFinancingResource extends JsonResource
{
@@ -16,9 +17,19 @@ class LeaseBasedFinancingResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'company' => $this->company,

View File

@@ -5,7 +5,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use App\Models\ProductImage;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class LongOnlyEquityResource extends JsonResource
{
/**
@@ -16,9 +16,19 @@ class LongOnlyEquityResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'fund_name' => $this->fund_name,

View File

@@ -3,6 +3,7 @@
namespace App\Http\Resources;
use App\Models\Product;
use App\Models\ProductImage;
use Illuminate\Http\Resources\Json\JsonResource;
class PeerToPeerLendingResource extends JsonResource
@@ -15,9 +16,20 @@ class PeerToPeerLendingResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'scheme' => $this->scheme,

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class PrivateEquityFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class PrivateEquityFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' =>Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'fund_name' => $this->fund_name,

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class PrivateInvestmentInPublicEquityFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class PrivateInvestmentInPublicEquityFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'fund_name' => $this->fund_name,

View File

@@ -4,6 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class PrivateRealEstateFundResource extends JsonResource
{
@@ -15,9 +16,19 @@ class PrivateRealEstateFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id) == false ? null : Product::find($this->products_id)->value('fact_sheet'),
'fund_name' => $this->fund_name,

View File

@@ -5,6 +5,9 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class SecuritizedDebtInstrumentResource extends JsonResource
{
/**
@@ -15,9 +18,19 @@ class SecuritizedDebtInstrumentResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'slug' => $this->slug,

View File

@@ -4,7 +4,7 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class VentureCapitalFundResource extends JsonResource
{
/**
@@ -15,9 +15,19 @@ class VentureCapitalFundResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null,
'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null,
'fund_name' => $this->fund_name,

View File

@@ -5,6 +5,8 @@ namespace App\Http\Resources;
use App\Models\Product;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\ProductImage;
class VentureDebtResource extends JsonResource
{
/**
@@ -15,9 +17,19 @@ class VentureDebtResource extends JsonResource
*/
public function toArray($request)
{
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
foreach ($images as $imageItem) {
$path = asset('public/' . $imageItem['images']);
$imagePaths[] = $path;
}
}
return [
'id' => $this->id,
'products_id' => $this->products_id,
'product_images' => $imagePaths,
'presentation' => Product::find($this->products_id)->value('presentation'),
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
'company_name' => $this->company_name,

View File

@@ -167,10 +167,7 @@ Route::group(['middleware' => ['auth:sanctum']], function () {
Route::post("update-profile", [ProfileController::class, 'updateAPI']);
Route::post("send-email-otp", [ProfileController::class, 'sendEmailOTPApi']);
Route::post("verify-user-email-or-contact-otp", [ProfileController::class, 'verifyOtpAPI']);
Route::post("verify-user-email-or-contact-otp", [ProfileController::class, 'verifyOtpAPI']);
Route::post('logout', [AuthController::class, 'userLogout']);
// Route::post("update-profile", [ProfileController::class, 'updateAPI']);
@@ -380,4 +377,4 @@ Route::get("global-industrial-estate/question-answer", [FractionalRealEstateFont
Route::get('/marketplace/spotlight-investment', [MarketPlaceController::class, 'spotlightInvestment'])->name('spotlight-investment');
Route::get('/marketplace/featured-investments', [MarketPlaceController::class, 'featuredInvestments'])->name('featured-investments');
Route::get('/marketplace/non-featured-investments', [MarketPlaceController::class, 'nonFeaturedInvestments'])->name('non-featured-investments');
// Route::get('/marketplace/offering/{slug}',[MarketPlaceController::class,'viewOfferingDataAPI'])->name('view-offering');
// Route::get('/marketplace/offering/{slug}',[MarketPlaceController::class,'viewOfferingDataAPI'])->name('view-offering');