N
N
NikSIk312020-08-25 14:42:17
Laravel
NikSIk31, 2020-08-25 14:42:17

Is it necessary to specify the length of the fields when migrating to Laravel?

I do migrations like name, about, ... for the user. So the question is: is it necessary to prescribe the length of the fields for such migrations, such as:
string('name', 40)
or
string('name')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2020-08-25
@Sanes

string will not be greater than 255 anyway.

V
Vladislav, 2020-09-04
@vos_50

If the size of your database is important to you, then it is better to specify the length

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question