Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #multiple #row #model #laravel
ADD COMMENT
Topic
Name
9+4 =