Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 082e116

Browse files
authored
Merge pull request #5 from jinoantony/add-timestamp-fields
Added created_at and updated_at snippets
2 parents 812a3fd + 34ddd17 commit 082e116

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Quickly get your models up and running with Laravel Model Snippets. Start with `
3434
| `Modal::tc` | Relationship Touches |
3535
| `Model::i` | Incrementing |
3636
| `Modal::pp` | Per Page Pagination |
37-
37+
| `Modal::cat` | Created At |
38+
| `Modal::uat` | Updated At |
3839

3940
## Changelog
4041

snippets/model.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,5 +295,29 @@
295295
"protected \\$perPage = $0;"
296296
],
297297
"description": "PerPage: The number of models to return for pagination."
298+
},
299+
"Laravel Model: Created At": {
300+
"prefix": "Model::cat",
301+
"body": [
302+
"/**",
303+
" * The name of the \"created at\" column.",
304+
" *",
305+
" * @var string",
306+
" */",
307+
"const CREATED_AT = '${1:created_at}';$0"
308+
],
309+
"description": "Created At: The name of the \"created at\" column."
310+
},
311+
"Laravel Model: Updated At": {
312+
"prefix": "Model::uat",
313+
"body": [
314+
"/**",
315+
" * The name of the \"updated at\" column.",
316+
" *",
317+
" * @var string",
318+
" */",
319+
"const UPDATED_AT = '${1:updated_at}';$0"
320+
],
321+
"description": "Updated At: The name of the \"updated at\" column."
298322
}
299-
}
323+
}

0 commit comments

Comments
 (0)