Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

academico-sis/academico

338 stars
2 code files
View academico-sis/academico on GitHub

app/Models/Invoice.php

Open in GitHub
class Invoice extends Model
{
//
public function setTotalPriceAttribute($value)
{
$this->attributes['total_price'] = $value * 100;
}
//
}

app/Http/Controllers/InvoiceController.php

Open in GitHub
use App\Models\Invoice;
use Carbon\Carbon;
use Illuminate\Http\Request;
 
class InvoiceController extends Controller
{
//
public function store(Request $request)
{
$invoice = Invoice::create([
'client_name' => $request->client_name,
'client_idnumber' => $request->client_idnumber,
'client_address' => $request->client_address,
'client_email' => $request->client_email,
'client_phone' => $request->client_phone,
'total_price' => $request->total_price,
'invoice_type_id' => $request->invoicetype,
'date' => $request->has('date') ? Carbon::parse($request->date) : Carbon::now(),
]);
//
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.