I'm not expert with Laravel, but as many other frameworks, it should have an ORM system ( Object Relational Mapping : https://en.wikipedia.org/wiki/Object-relational_mapping ), this systems helps you to 'speak' to databases in an object oriented fashion ( with methods like getFirstByPrimaryKey( $primaryKey ) ).
This said, I think that kind of systems are better when you already know how to do it manually.
In the case you are proposing, you have to think first what you need, and then think what's the better approach to accomplish it.
What you need:
Insert a ticket for one user if that user has more or equals some quantity.
Let me suppose, perhaps you're going to detry that quantity from money field after a successful ticket creation, right ?
So I think we're selling a ticket, and the normal steps should be:
Check if user is logged. If it's logged, we probably have the user id in session or a similar system. It's much better to search in indexed numeric fields, if possible.
Once we have the user_id, we update the row if that user id has enough money for this action:
//pseudo code
$userId = 12;
$cost = 200;
$query = "update ticketstable set tickets=tickets+1, money=money-$cost
where id='$userId' and money >= $cost";
$result = $db->query($query);
if($result){
//row with id = $userId has been updated
}else{
//There's not a row with $userId, or that row's money was less than $cost
}
Take in account when dealing with money operations that you should make all related queries as a transaction ( a transaction in database argot means several sql sentences executed together, in a way that if some fails, all others are reverted, to avoid inconsistency ).
If you divide my proposal in two queries:
1) check if user with id=x has money >= $cost;
2) update money -= $cost;
You can find in a situation where the user or other automated process takes some money from the same row between the steps 1 and 2, and then you end with negative money, and allowing an operation you shouldn't.