Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel 8 storing dynamic checkbox integer value array

if (isset($_POST['roleSubmit'])){
    DB::table('role_users')->where('user_id', $request->get('id', $id))->delete();


    $userRole = $request->input('rolename');
    foreach($userRole as $role){
        DB::table('role_users')->insert(
           array(
             'user_id' => $id,
             'role_id' => $role
           )
        );
    }
    return redirect()->back();
}
Comment

PREVIOUS NEXT
Code Example
Php :: SQLSTATE[HY000]: General errorstring(58) 
Php :: code to set error for du[licate entry in php 
Php :: joomla include jfactory 
Php :: use app http models in laravel 8 
Php :: laravel dispatch execute multiple 
Php :: Drupal 9 select node data with query conditions using entity type manager 
Php :: multiple submit button form to multiple php files 
Php :: drupal 7 hook_node_insert 
Php :: laravel route namespace and prefix 
Php :: is_resource returns false 
Php :: Round Number Up 
Php :: ph address format 
Php :: fxcjahid 
Php :: nested attributes - PHP 8.1 
Php :: php select disable submit no value 
Php :: white labeling wordpress divi 
Php :: php tableaux 
Php :: what returns livewire mount 
Php :: wordpress single_cat_title slug 
Php :: eager loading set limit to relationship 
Php :: Do not call the observer when there is a model update in laravel 
Php :: Yii2 Dynamic Relational, Eager loading 
Php :: supprimer un cookie avec un input en php 
Php :: number format rupiah 
Php :: PHPMailer/SMTP.php line 467 
Php :: strtolower cyrillic 
Php :: laravel migration add column first 
Php :: woocommerce check if shop page 
Php :: how to pass value from one php page to another using session 
Php :: how did peppa pig die 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =