Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how get year of field database in laravel collection

$post = Post::find(2);

$year = $post->created_at->year;
$month = $post->created_at->month;
 
PREVIOUS NEXT
Tagged: #year #field #database #laravel #collection
ADD COMMENT
Topic
Name
5+8 =