D
D
Denis Bukreev2017-05-03 00:36:10
Laravel
Denis Bukreev, 2017-05-03 00:36:10

What does the default() modifier mean in Laravel - Migrations?

I'm picking the docks and I see this sign:
c3520727d8014fe794620a18ea3504c3.png
Modifiers and a description that is incomprehensible to a beginner.
Modifier ->default($value)- the value specified in brackets will be substituted if the field is ... what? Not filled? Duck at me an error in that case mysql issues. It's not clear in the end.
With the rest, too, a lot of questions arise, but they are not important at the moment.
I do not understand why it is impossible to expand the docks with links to examples. Documentation, in the end, is needed only for those who are already well versed in PHP frameworks or for those who just need to refresh their memory.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-05-03
@denisbookreev

incomprehensible description for a beginner.

google translate banned
default - standard
value - if you do not specify
this column in the query at all, then the standard value will be put down.
insert into table (`column1`) values ('value1'); // column2 = nothing to do here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question