Skip to content

Support custom column name for softDeletes() - #19203

Merged
taylorotwell merged 1 commit into
laravel:5.4from
meness:5.4
May 15, 2017
Merged

taylorotwell merged 1 commit into
laravel:5.4from
meness:5.4

Conversation

@meness

@meness meness commented May 15, 2017

Copy link
Copy Markdown
Contributor

Hi,

Changing the default deleted_at column name is possible by creating a new constant called DELETED_AT.

$table->softDeletes(); // creates 'deleted_at' column

$table->softDeletes('left_at'); // creates 'left_at' column

@taylorotwell
taylorotwell merged commit d394341 into laravel:5.4 May 15, 2017
@stefensuhat

Copy link
Copy Markdown

can we specify specific column name for softdeletes at model?

@meness

meness commented May 31, 2017

Copy link
Copy Markdown
Contributor Author

@stefensuhat Define const DELETED_AT = 'column_name'; in your model.

salmanarshad321 pushed a commit to salmanarshad321/framework that referenced this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants