App\Http\Controllers\ReportController::d3 PHP Method

d3() public method

public d3 ( ) : Illuminate\Contracts\View\View
return Illuminate\Contracts\View\View
    public function d3()
    {
        $message = '';
        $fileName = storage_path() . '/dataviz_sample.txt';
        if (Auth::user()->account->hasFeature(FEATURE_REPORTS)) {
            $account = Account::where('id', '=', Auth::user()->account->id)->with(['clients.invoices.invoice_items', 'clients.contacts'])->first();
            $account = $account->hideFieldsForViz();
            $clients = $account->clients->toJson();
        } elseif (file_exists($fileName)) {
            $clients = file_get_contents($fileName);
            $message = trans('texts.sample_data');
        } else {
            $clients = '[]';
        }
        $data = ['clients' => $clients, 'message' => $message];
        return View::make('reports.d3', $data);
    }