Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lblanks240's avatar

How do I make a check box using Laravel?

I have the Sponzy script written in Laravel and for ccbill to allow me to accept credit card i have to add a checkbox for the creator to accept the performers consent. I know who to get the checkbox to work in using java but not using Laravel. When i tried using the java code in the sponzy script when you check the box it automatically sends the information without clicking the button. How do i write the checkbox code using Laravel?

{{trans('general.send_approval')}}

i tried writing the script in java and expected it to work, but it didn't.

php laravel checkbox
0 likes
3 replies
martinbean's avatar

@lblanks240 Laravel is a framework written in PHP, a server-side language. Checkboxes are HTML elements. You add mark-up for a checkbox inside a <form> in a Blade template somewhere:

<input type="checkbox" name="some_name">

When the form is submitted, the controller action handling the form will receive a value of on for some_name if the checkbox was checked.

jlrdw's avatar

Also like @martinbean stated:

if the checkbox was checked.

So in the controller you can see if that is in the request with:

https://laravel.com/docs/11.x/requests#input-presence

Docs example:

if ($request->has('your_checkbox_name_here')) {
    // ...
}

A non checked checkbox passes nothing. And just FYI checkboxes has been covered many times in past post.

Also are you using validation and old data? These are also things to consider.

Please or to participate in this conversation.