Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Update without touching timestamps (Laravel)

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 524
    Comment on it

    I want to update my data but I dont want to update my timestamps. Laravel 4.x provide us the facility to update our data without updating our timestamps.

    The example to Update without touching timestamps using Laravel 4.x is:

    $user = User::find(1);
    $user->timestamps = false;
    $user->age = 72;
    $user->save();
    

    Here User is a model and save is a method which will use to update the data. By using

    $user->timestamps = false;
    

    By using this we will temporarily disable the timestamps update.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: