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 :: strip non numeric and period php 
Php :: access json with php 
Php :: laravel model 
Php :: php print object 
Php :: laravel collection sum 
Php :: text box should accept only alphanumeric not special characters in php 
Php :: enum in migration laravel 
Php :: symfony rabbitMQ 
Php :: convert png image transparent into webp php 
Php :: array value search in php 
Php :: laravel check if api request 
Php :: php get index of string 
Php :: how check the checkbox is check php 
Php :: php if negative then 0 
Php :: Hide Categories - Woocommerce Product Page 
Php :: php find multiple value in array 
Php :: template string php 
Php :: php Program to check if a given year is leap year 
Php :: laravel max length format 
Php :: two condition in one laravel query 
Php :: php interval day value 
Php :: remove all items of an array except the last 5 in php 
Php :: laravel route multiple middleware 
Php :: laravel model factory attribute 
Php :: remove invalid characters from a string laravel 
Php :: orderby not working with groupby laravel 
Php :: laravel update multiple select query 
Php :: codeigniter4 route optional parameter 
Php :: use session in laravel 
Php :: php array current 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =