Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: softDeletes Support #48

Open
EHLOVader opened this issue Jun 9, 2015 · 5 comments
Open

Feature Request: softDeletes Support #48

EHLOVader opened this issue Jun 9, 2015 · 5 comments

Comments

@EHLOVader
Copy link

This would be a nice to have. Appears that it would require additional work model side though.

I don't know if that would work.

@andreluizmorita
Copy link

#58

@tabacitu
Copy link
Contributor

tabacitu commented Mar 8, 2020

@EHLOVader are you still using this package, and want it to support SoftDeletes? I now have write access and would love SoftDeletes too.

I know Jeffrey passed on it, but it was probably due to him not wanting to maintain it, rather than feeling it's not a good idea. If we have a good PR for it, I think it's very much worth including in v2 #170. The package is finally getting the love it needs - no better time to work on this feature than now 😄

Let me know if you are able to help with this, I'd love to have SoftDeletes support in v2.

Cheers!

@eightyfive
Copy link

I think this feature should include all possible special column types.

These are the types that don't specify a column name:

$table->timestamps();
$table->rememberToken();
$table->softDeletes();
// ...

So they would be pretty easy to identify in SchemaParser:: parseSegments.

Validation should use something like method_exists(Blueprint::class, $field[0]), not checking for names.

I can have a go at it. Let me know.

PS: Is there already some kind of validation of all columns types in place?

@tabacitu
Copy link
Contributor

tabacitu commented May 3, 2020

Please take a stab at it, if you can, @eightyfive . Personally I see it as a flag, rather than the previous implementation. Something like:

php artisan make:migration:schema create_groups_table --schema="name:string:unique,description:string" --softDeletes

@eightyfive
Copy link

Hi,

I took a different approch in another package:
https://github.com/eightyfive/laravel-exodus/blob/master/src/Exodus.php#L118

I basically allow any "special" column types: id(), rememberToken(), timestamps(), softDeletes(), etc...

Let me know @tabacitu if this is something you would like to see implemented in the generators.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants