Mohammad
Mohammad

Reputation: 85

laravel migration error after define defaultStringLength

i get this error after define 'defaultStringLength'

[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultSt ringLength()

Upvotes: 0

Views: 152

Answers (2)

Kuldeep Mishra
Kuldeep Mishra

Reputation: 4040

Follow this url: https://laravel.com/docs/5.0/schema

$table->string('name', 100);

Upvotes: 0

Alexey Mezenin
Alexey Mezenin

Reputation: 163948

You're using an older version of Laravel. You can use this method only since 5.4

You can limit string length manually:

$table->string('name', 100);

Upvotes: 2

Related Questions