My table does not have a primary key.I want to use userId and cartId together.
public function delete($uyeid,$Id){
$this->getCart($Id)->delete();
}
public function getCart($Id){
try {
$data = getCart::whereCartId($Id)->get();
return $data;
} catch(\Exception $e){
return null;
}
}
Should I define 2 column as primary? how?