Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Laravel 5.0 Defining Different Named Fields as CREATED_AT And UPDATED_AT

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 308
    Comment on it

    In Laravel two fields are auto filled or modified they are created_at and updated_at but what if your table have different named fields example created and modified in it's place they won't be auto filled or modified automatically. So to make them replacement of created_at and modified_at you need to add the following lines to your table model.

     /**
         * The name of the "created at" column.
         *
         * @var string
         */
        const CREATED_AT = 'created';
    
        /**
         * The name of the "updated at" column.
         *
         * @var string
         */
        const UPDATED_AT = 'modified';
    

 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: