Search
 
SCRIPT & CODE EXAMPLE
 

PHP

delete multiple row in laravel

DB::table('users')->delete();

DB::table('users')->where('votes', '>', 100)->delete();
Comment

how delete multiple row from relation in laravel

AppPost;
$post = Post::find($id);
Comment::where('post_id',$post)->delete();
Comment

delete multiple row by model in laravel

public function destroy($id)
{
    if (is_array($id)) 
    {
        Product::destroy($id);
    }
    else
    {
        Product::findOrFail($id)->delete();
    }
    // redirect or whatever...
}
Comment

laravel delete multiple rows

$org->products()->whereIn('id', $ids)->delete()
Comment

How to Delete Multiple Records using Checkbox in Laravel

public function deleteAll(Request $request)
{
  $ids = $request->ids;
  DB::table("products")->whereIn('id',explode(",",$ids))->delete();
  return response()->json(['success'=>"Products Deleted successfully."]);
}
//@sujay
Comment

PREVIOUS NEXT
Code Example
Php :: joomla get group id 
Php :: isempty php 
Php :: .htaccess Prevent access to php.ini 
Php :: php clear post data 
Php :: update laravel 
Php :: php check image size before upload 
Php :: php sort() 
Php :: woocommerce get the price from session after add to cart 
Php :: php add get to link 
Php :: last item coma replace and php 
Php :: How to add custom button in wordpress admin section 
Php :: php pdo sql server connect 
Php :: python to php 
Php :: url segment in laravel 
Php :: if exists in string count php 
Php :: drop table phpmyadmin 
Php :: rodar migration especifica laravel 
Php :: create table laravel 
Php :: aws sdk php 
Php :: php declare array 
Php :: how to get client ip address in php 
Php :: laravel collection search 
Php :: like %% inside the string php 
Php :: php variable as javascript function parameter in echo 
Php :: Laravel Migration - Update Enum Options 
Php :: How do I get a YouTube video thumbnail from the YouTube API? 
Php :: smarty php 
Php :: naming the routes in laravel 
Php :: php generate unique id for word 
Php :: laravel blade if else condition 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =