I'm using Eloquent to save() a new person into my database. The persons name contains a special character é and it's not submitting. Here are my steps and the results.
echo Input::get('firstname'); // Miguél
Which gives me this
Miguél
When i start using eloquent the following happens.
$person = new Person(); echo $person->firstname = Input::get('firstname');
This produces the following result
Any idea what might be going wrong? These are my config settings in laravel
And this is my database in phpmyadmin
Thanks
I don't think it has anything common with database.
When you use:
$person = new Person(); echo $person->firstname = Input::get('firstname');
you don't use database in here. You just assign properties to Person class (that probably uses Eloquent) but you don't put anything into database and get anything from database so it's not possible that the encoding problem has anything in common with database itself
Potential problem in my opinion - you have defined mutator in Person
class for firstname
attribute because you have it in lowercase (when you get it from Input it's with capital letter) so you probably use some function like strtolower
and you should use mb_strtolower
to convert UTF-8 strings without a problem.