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

Refactor Staff model #1793

Open
wants to merge 27 commits into
base: 1.x
Choose a base branch
from
Open

Conversation

adevade
Copy link
Contributor

@adevade adevade commented May 28, 2024

Note: This PR is easiest to review commit by commit. Feel free to pick and choose what you like and revert the ones you don't.

The reason for removing the Docblocks is because Filament barely uses any. With clear property/method names, type hints and return types they often feel superfluous.

I think that we can remove the custom route binding after this PR was merged in Livewire(?)

I usually use my accessors as the rest of my attributes (snake cased), but don't know if you have a strong preference? Both still works. Especially in $appends I think it should be snake cased, since otherwise it would be mixing case with the other fields from the DB.

Marking as draft for now, to let the tests run and get some feedback.

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 10:01am

@adevade adevade marked this pull request as ready for review August 22, 2024 09:24
@alecritson
Copy link
Collaborator

@adevade Sorry this one took a while, looks pretty okay to me. I've added a small test (which didn't exist before) lmk your thoughts and we can get this merged.

@adevade
Copy link
Contributor Author

adevade commented Sep 13, 2024

@alecritson Nice work with the test! 👍

One thing I noticed is that firstname and lastname is defined without underscores. Should fullname be that as well, for consistency? Easier than migrating both first and last name columns I guess?

@alecritson
Copy link
Collaborator

@alecritson Nice work with the test! 👍

One thing I noticed is that firstname and lastname is defined without underscores. Should fullname be that as well, for consistency? Easier than migrating both first and last name columns I guess?

I think if anything we'd be better to migrate firstname to first_name it's something that's bothered us internally since elsewhere we use underscores. Not sure if it's something we need to worry about right now though @glennjacobs ?

@glennjacobs
Copy link
Contributor

@alecritson Nice work with the test! 👍
One thing I noticed is that firstname and lastname is defined without underscores. Should fullname be that as well, for consistency? Easier than migrating both first and last name columns I guess?

I think if anything we'd be better to migrate firstname to first_name it's something that's bothered us internally since elsewhere we use underscores. Not sure if it's something we need to worry about right now though @glennjacobs ?

I guess if we don't do it now, then it may never get another look. So maybe we get it done in this PR?

"SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification."
@adevade
Copy link
Contributor Author

adevade commented Nov 25, 2024

I've now updated the code base to use first_name and last_name.

Since users might be referencing $staff->firstname in their own code, I've added fallback accessor and mutators for both $firstname and $lastname on the Staff model.

I did not update the CLI argument keys on MakeLunarAdminCommand, since it feels better for them to not have underscores.

I have not yet touched any documentation.

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.

4 participants