I would suggest to use addBinding() for security purposes. Bindings is the key way to defend against mysql injection laravel using.
Jan 4, 2017
3
Level 1
Laravel Raw Expression and SQL Injection
I found some code that allows me to generate a raw expression: $this->getConnection()->raw();. It returns an \Illuminate\Database\Query\Expression object, but I'm not sure if this will be safe and I'm not creating a SQL injection point.
Will Laravel do something to prevent this? Or should I sanitize the input before? How can I do this?
Please or to participate in this conversation.