Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel: Set timestamp column to current timestamp

<?php

/* For Create */
$table->timestamp('created_at')->useCurrent();

/* For Update */
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
Comment

custom timestamp column laravel

class BaseModel extends Eloquent {
    const CREATED_AT = 'date_created';
    const UPDATED_AT = 'date_modified';
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel model with migration 
Php :: php-fpm docker 
Php :: php get first character of each word 
Php :: php password verify 
Php :: php write to standard out 
Php :: specification migration laravel 
Php :: if else if php code reflect 
Php :: custom pagination laravel css 
Php :: how to get woocommerce order details 
Php :: convert_uudecode (PHP 5, PHP 7, PHP 8) convert_uudecode — Decode a uuencoded string 
Php :: factory laravel laravel 8 tinker 
Php :: @foreac laravel 
Php :: wp_localize_script 
Php :: doctrine querybuilder select alias 
Php :: reset id auto increment after deleting a table row in phpmyadmin 
Php :: on running php file showing code instead of view 
Php :: php mail in localhost wamp 
Php :: get filesize php 
Php :: codeigniter base_url 
Php :: laravel move file from local to s3 
Php :: gettype() function in PHP 
Php :: blank admin page magento 2.3 
Php :: wordpress post autosave time 
Php :: php require 
Php :: php check if string is integer 
Php :: wordpress if is not page template 
Php :: get redirect url for laravel socialite with api 
Php :: laravel faker select between options 
Php :: acf sub_field image title 
Php :: array value search in php 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =