0
votes

i get this error after define 'defaultStringLength'

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

2
plz provide the migrations's code - Mahdi Younesi
@mohammad post your database/migration migration table - bipin
Why this have a blank space defaultSt ringLength()? Please post your code and laravel version too - Shubham Pokhriyal

2 Answers

2
votes

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);
0
votes

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

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