0
User.phpLaravelスコープ照会とカウントして表示
public function queryCountusers($query){
$query->where(['confirmation' => true])->whereIn('role_id', [2, 3])->count();
}
UserController.php
public function index() {
// $users = App\User::popular()->active()->orderBy('created_at')->get();
$count_user = User::countusers();
return view('admin.index', compact('count_user'));
}
main.blade.php
<div class="tile-stats tile-red">
<div class="icon"><i class="entypo-users"></i></div>
<div class="num" data-start="0" data-end="{{$count_user}}" data-postfix="" data-duration="1500" data-delay="0">0</div>
<h3>Registered users</h3>
<p>so far in our blog, and our website.</p>
</div>
問題は、私がいるさ
未定義のメソッドへコール を照らし\データベース\クエリー\ビルダー:: countusers()
これで私を助けてください。 THakns
にまだエラーがまだそこに – d3cypher
同じエラーメッセージのですか? – shoieb0101
はい、あなたはまだエラーがあります。 – d3cypher