Graphic::get('amount') This doesn't work indeed. You need to fetch it by some identifier. Here is an example
Graphic::find(1)->amount,
1 in the find method here is the id of the Graphic model in the database.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i just want to get amount from database directly to stripe dashboard
$stripe = new Stripe(env('STRIPE_SECRETE'));
$charge = $stripe->charges()->create([
// 'amount' => Graphic::get('amount'), i tried this but it does'nt work
'amount' => 1000,
'currency' => 'rwf',
'description' => 'Your work done info',
'source' => $request->get('stripeToken'),
'receipt_email' => $request->get('email'),
// Verify your integration in this guide by including this parameter
'metadata' => [
'order_id' => 3243,
],
]);
when i used the console i worked that's what i use thanks yah all for your help
Please or to participate in this conversation.