How to calculate the payment frequency of shareholder In Laravel

I want to get the due date and payment amount plus payment frequency of each shareholder in laravel.
assume subscription_date = 23/09/2023 subscribed_share = 5 one share value =1000 paidup_share = 1 unpaidup_share = subscribed_share – paidup_share payment = by monthly (31) based on this operation how to get expected payment and due date of this share collection. Any one please gives me idea I’m New for Laravel. kindly

This Is My Controller Named SharesubscribeController
<?php namespace AppHttpControllersAdmin;

use AppHttpControllersController;
use AppModelsAdminSharesubscribe;
use AppModelsAdminSharecollaction;
use AppModelsAdminCompany;
use IlluminateHttpRequest;
use IlluminateSupportStr;
use IlluminateValidationRule;
use CarbonCarbon;
use DB;

class SharesubscribeController extends Controller {
public function __construct() {
    $this->middleware('admin');
}

public function index() {
    //$sharesubscribe = Sharesubscribe::all();
    //return view('admin.company.sharesubscribe.index', compact('sharesubscribe'));

    $companye =DB: :table('companies')->get();
    $client=DB: :table('clients')->get();
    $sharesubscribe =Sharesubscribe: :all();
    return view('admin.company.sharesubscribe.index', compact('sharesubscribe', 'companye', 'client'));
}

public function detail($id) {

    $company =DB: :table('companies')->where('id', 1)->first();
    // $subscribe_detail = DB::table('clients')->where('id', 1)->first();

    $subscribe_detail =DB: :table('clients')->where('id', $id)->first();
    $subscribe_list =DB: :table('sharesubscribes')->where('shareholder', $id)->get();
    return view('admin.company.sharesubscribe.detail', compact('subscribe_detail', 'subscribe_list', 'company'));
}

public function create() {
    $company=DB: :table('companies')->get();
    $client=DB: :table('clients')->get();
    return view('admin.company.sharesubscribe.create', compact('client', 'company'));
}

public function store(Request $request) {
    $sharesubscribe =new Sharesubscribe();
    $data =$request->only($sharesubscribe->getFillable());

    $request->validate([ 'company_id '=> '',
        'client_type'=> '',
        'partial_payable'=> '',
        'subscribed_share'=> 'required',
        'price_per_share'=> '',
        'subscribed_date'=> 'required',
        'payment_date'=> '',
        'payment_amount'=> '',
        'total_unpaid_share'=> '',
        'total_paidup_share'=> '',
        'paidup_share'=> '',
        'term'=> '',
        'payment_frequancy'=> '',
        'maturity_date'=> '',
        'refrence'=> '',
        'description'=> '',
        'total_paidup_share'=> '',
        'total_unpaid_share'=> '',
        'created_by'
        ]);

    $statement =DB: :select("SHOW TABLE STATUS LIKE 'sharesubscribe'");
    $sharesubscribe =new Sharesubscribe();
    $data =$request->only($sharesubscribe->getFillable());
    $total_paidup_share =$request->subscribed_share - $request->paidup_share;
    $subscribed_date =$request->input('subscribed_date');
    $payment_date =$request->input('payment_date');
    $paidup_share =$request->input('paidup_share');
    $payment_amount =$request->input('payment_amount');
    $shareholder =$request->input('shareholder');
    $subscribed_share =$request->input('subscribed_share');

    $term =12;
    $maturity_date =$request->input('maturity_date');
    $payment_frequancy =$request->input('payment_frequancy');
    $date_approval =$request->input('subscribed_date');
    $company_detail =DB: :table('companies')->where('id', $request->company_id)->pluck('authorized_share')->first();

    if(empty($data['subscribed_share'])) {
        unset($data['subscribed_share']);
        $data['subscribed_share']=Str: :slug($request->id);
    }

    if($subscribed_share > $company_detail) {
        return redirect()->back()->with ('error', 'Sorry! There are only ' .$company_detail.' Authorized share(s) in the company! First Please Authorized More Share');
    }

    if ($payment_date < $subscribed_date) {
        return redirect()->back()->with ('error', 'Sorry! Your Subscribed Date is ' .$subscribed_date.' Payment Date Not Less than Subscribed Date ');
    }

    if ($paidup_share > $subscribed_share) {
        return redirect()->back()->with ('error', 'Sorry! Your Subscribed Share is ' .$subscribed_share.' Paidup share Not Greater than Subscribed Share ');
    }

    $company_detail =DB::table('companies')->where('id', $request->company_id)->pluck('authorized_share', 'capital')->first();
    $new_authorized_share =(int)$company_detail - (int)$request->subscribed_share;
    // $new_capital = (int)$new_authorized_share * (int)$request->price_per_share;
    Company::whereId($request->company_id)->update(['authorized_share'=> $new_authorized_share]);
    // Company::whereId($request->company_id)->update(['capital' => $new_capital]);


    $date_approval =Carbon::createFromTimestamp(strtotime($sharesubscribe->subscribed_date));
    $new_term =$term * $num_days;


    $days =(intdiv($date_approval->diff(Carbon::now())->days, $term) + 1) * $term $data['maturity_date']=$date_approval->addDays($days)->format('M d Y');
    DB::raw('SUM(price) as total_sales') //$data['partial_payable']    = ('Individual');



    $data['serial_no']=mt_rand(1000000000, 9999999999);
    $sharesubscribe->fill($data)->save();
    return redirect()->route('admin.company.sharesubscribe.index')->with ('success', 'Share Subscription is added successfully!');
}

}
?>

This is my Model named Sharesubscribe

<?php namespace AppModelsAdmin;
use IlluminateDatabaseEloquentModel;
class Sharecollaction extends Model {
protected $fillable =[ 'company_id',
'shareholder_id',
'subscribed_share',
'share_subscription_id',
'price_per_share'=>1000,
'subscribed_date',
'paidup_share',
'payment_date',
'payment_amount',
'partial_payable',
'term',
'payment_frequancy',
'maturity_date',
'total_share',
'serial_no',
'transaction_id',
'refrence',
'description',
'total_paidup_share',
'total_unpaid_share',
'created_by'
];

public function Company() {
    return $this->hasOne('AppModelsAdminCompany', 'id', 'company_id');
}

public function Client() {
    return $this->hasOne('AppModelsAdminClient', 'id', 'shareholder_id');
}

public function Sharesubscribe() {
    return $this->hasOne('AppModelsAdminSharesubscribe', 'id', 'share_subscription_id');
}

}
?>
This is My Blade php Named Index

@extends('admin.admin_layouts') @section('admin_content') <h1 class="h3 mb-3 text-gray-800">Authorized Share</h1>
<div class="card shadow mb-4">
<div class="card-header py-3">
    <h6 class="m-0 mt-2 font-weight-bold text-primary">View Authorized Share</h6>
    <div class="float-right d-inline"><a href="{{ route('admin.company.authorizedmore.create') }}" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i>Add New</a></div>
</div>
<div class="card-body">
    <div class="table-responsive">
        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
            <thead>
                <tr>
                    <th>SL</th>
                    <th>authorized Share</th>
                    <th>Per Value</th>
                    <th>Capital</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>@foreach($authorizedmore as $row) <tr>
                    <td> {
                        {
                        $loop->iteration
                        }
                        }

                    </td>
                    <td> {
                        {
                        $row->authorized_amount
                        }
                        }

                    </td>
                    <td> {
                        {
                        $row->currency
                        }
                        }

                        {
                        {
                        $row->per_value
                        }
                        }

                    </td>
                    <td> {
                        {
                        $row->currency
                        }
                        }

                        {
                        {
                        number_format($row->capital, 3)
                        }
                        }

                    </td>
                    <td>
<div class="filter-dropdown text-right"><button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action</button>
                            <ul class="dropdown-menu"><a href="{{ URL::to('admin/company/authorizedmore/edit/'.$row->id) }}" class="btn btn-warning btn-sm btn-block"><i class="fas fa-edit"></i>Edit</a>
                                <li>
                                    <hr class="dropdown-divider">
                                </li><a href="{{ URL::to('admin/company/authorizedmore/delete/'.$row->id) }}" class="btn btn-danger btn-sm btn-block" onClick="return confirm('Are you sure?');"><i class="fas fa-trash-alt"></i>Delete</a>
                    </td>
                </tr>@endforeach </tbody>
        </table>
    </div>
</div>

@endsection

I really thank for taking your time!