Laravel postgresql 的蓝图 inet 类型

Laravel blueprint inet type for postgresql

我需要在我的项目 (laravel) 中进行迁移以创建一些新表,其中一个表必须具有 inet 类型的列,所以我这样做了:

Schema::create('host_servers', static function (Blueprint $t) {
    //...
    $t->addColumn('inet', 'ip');
    //...
});

但是当我 运行 php artisan migrate 它说:

BadMethodCallException : Method Illuminate\Database\Schema\Grammars\PostgresGrammar::typeInet does not exist.

基于@Remul comment, the answer is ipAddress

$t->ipAddress('column_name');