如何修复 Laravel 8 中丢失的 mediumText
How to fix missing mediumText in Laravel 8
当我 运行 php artisan migrate 命令时我得到这个错误
Migrating: 2022_01_09_133840_create_posts_table
BadMethodCallException
Method Illuminate\Database\Schema\Blueprint::mediumtText does not exist.
at C:\Users\Ali\Documents\workspace\firstproject\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:113
109▕ */
110▕ public function __call($method, $parameters)
111▕ {
112▕ if (! static::hasMacro($method)) {
➜ 113▕ throw new BadMethodCallException(sprintf(
114▕ 'Method %s::%s does not exist.', static::class, $method
115▕ ));
116▕ }
117▕
• Bad Method Call: Did you mean Illuminate\Database\Schema\Blueprint::mediumText() ?
这是我的代码
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
//$table->id();
$table->string('title');
$table->mediumtText('body');
$table->timestamps();
});
}
我打开了 Laravel 8 文档,发现 mediumText 没有被弃用
我该怎么办?
检查您在架构中给出的内容之间的区别:
Illuminate\Database\Schema\Blueprint::mediumtText does not exist
以及他们的建议:
Illuminate\Database\Schema\Blueprint::mediumText
当我 运行 php artisan migrate 命令时我得到这个错误
Migrating: 2022_01_09_133840_create_posts_table
BadMethodCallException
Method Illuminate\Database\Schema\Blueprint::mediumtText does not exist.
at C:\Users\Ali\Documents\workspace\firstproject\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:113
109▕ */
110▕ public function __call($method, $parameters)
111▕ {
112▕ if (! static::hasMacro($method)) {
➜ 113▕ throw new BadMethodCallException(sprintf(
114▕ 'Method %s::%s does not exist.', static::class, $method
115▕ ));
116▕ }
117▕
• Bad Method Call: Did you mean Illuminate\Database\Schema\Blueprint::mediumText() ?
这是我的代码
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
//$table->id();
$table->string('title');
$table->mediumtText('body');
$table->timestamps();
});
}
我打开了 Laravel 8 文档,发现 mediumText 没有被弃用
我该怎么办?
检查您在架构中给出的内容之间的区别:
Illuminate\Database\Schema\Blueprint::mediumtText does not exist
以及他们的建议:
Illuminate\Database\Schema\Blueprint::mediumText