简体   繁体   中英

Laravel : how to check if a specific value was selected

I have a very newbie question in Laravel.

In the controller I want to create something like :

if ($Q_type = "specific Value selected by the end user in a radio button") 
{
    do an action
}

what is the syntax to check this specific value ?

You can do it in the following way:

if(request()->Q_type == "blue") 
{
    return 'blue';
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM