$ pkg install github
说:
Reading state information... Done
E: Unable to locate package github
答案 0 :(得分:1)
您只需输入即可安装git
<?php
namespace App\Nova\Filters;
use Illuminate\Container\Container;
use Illuminate\Http\Request;
use Laravel\Nova\Filters\Filter;
class MyFilter extends Filter
{
//...
public function apply(Request $request, $query, $value)
{
//Same select fields as in model with userid, dont skip select in the filter!
return $query
->select('user.id', 'user.id as userid'/*,...*/)
->[...];
}
//...
但是,如果您遇到任何错误,那么在安装git之前,您应该先运行
<?php
namespace App\Nova;
use App\Nova\Filters\MyFilter;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
class User extends \App\Nova
{
//...
public function fields(Request $request)
{
return [
//userid
Boolean::make('some', function () {
return \App\Models\User::myScope($this->userid);
}),
];
}
//...
}
,此操作将更新所有依赖项,并且不会出现任何错误。 如果您想进一步了解termux,请访问我的网站www.learntermux.tech
答案 1 :(得分:0)
您需要安装git
而不是github
。 Github.com是 a git托管,是许多托管托管托管服务(尽管其中最著名的一种)。
来自https://wiki.termux.com/wiki/Development_Environments:
pkg up
pkg install git