Level 73
What do you mean?
$variableName;
$anotherVariableName = 'Value';
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
{!! public $stripe_total_balance; public function index(){
$total_stripe_amount = Stripe_Deposite::get();
foreach ($total_stripe_amount as $stripe_balance) {
$balance = 0;
$total_balance = $balance + $stripe_balance->amount;
$this->$stripe_total_balance = ;
dd();
} !!}
I have this code i want to add the all stripe deposit record to store in a variable and return with view.
Inside the method you just
$variableName;
If it's a property that is accessible for the whole controller you
protected $variableName;
To access the property you need to use
$this->variableName;
I suggest you take some of the OOP lessons on this site.
Please or to participate in this conversation.