Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to update user profile fields?
  • Hello,

    I can use Auth::get_profile_fields to get the values.
    How do I reverse this and store data in the profile text field?

    I tried searching and cannot find it.

    Thanks
  • HarroHarro
    Accepted Answer
    You can use the update_user() method.

    Any fields passed that are not user record columns will be added to the profile fields.

    If you want to do it directly, then for OrmAuth you can use the Model's, profile data is stored in the users meta data (it's an EAV container). When using SimpleAuth it is stored as a serialized array that you need to unpack and pack yourself.
  • Thanks Harro, I am using SimpleAuth
  • sunnyuffsunnyuff
    Accepted Answer
    Hi Frocco,
    Here is a very basic example for simpleauth...
    Auth::create_user(
    Input::post('username'),
    Input::post('password'),
    Input::post('email'),
    1, //Group id, depends on what logic you are using.
    array(
    "firstname" => Input::post('firstname'),
    "lastname"  => Input::post('lastname'),
    )
    );

    It returns userid if successful, otherwise false.
  • Thank you

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion