D
D
Dmitry2020-09-04 11:08:59
Laravel
Dmitry, 2020-09-04 11:08:59

How to perform actions on model properties before saving?

For example, the users table has a phone field. How can I clean the phone number from unnecessary characters in the User model before creating a new record in the database, updating it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2020-09-04
@mayken

You can use Form Request Validation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question