mardi 9 juin 2020

Error Call to undefined function App\Http\Controllers\Admin\get_option()

hello i update of laravel 5.4 to 5.7 to 5.8 to 6 and finely to 7.14 and i see get_option error

public function user()
{
    $userCount = User::where('admin','0')->count();
    $adminCount = User::where('admin','1')->count();
    $buyerCount = Sell::distinct('buyer_id')->count('buyer_id');
    $sellerCount = Sell::distinct('user_id')->count('user_id');
    $dayRegister = User::where('create_at','>',strtotime('-'.get_option('chart_day_count',10).' day')+12600)->get();
    return view('admin.report.user',['userCount'=>$userCount,'adminCount'=>$adminCount,'buyerCount'=>$buyerCount,'sellerCount'=>$sellerCount,'dayRegister'=>$dayRegister]);
}

in laravel 5.4 i defined in helper method

function get_option($option,$default = null){
    if($result = \App\Models\Option::where('option',$option)->value('value'))
        return $result;
    else
        return $default;
}

but in laravel 7 not work!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UqPNzB
via IFTTT

Aucun commentaire:

Enregistrer un commentaire