Giter Site home page Giter Site logo

How can i disable Analytics (just in local env) ? then enable it when I public my website on a real host about laravel-9-simple-cms HOT 4 CLOSED

ozdemirburak avatar ozdemirburak commented on July 1, 2024
How can i disable Analytics (just in local env) ? then enable it when I public my website on a real host

from laravel-9-simple-cms.

Comments (4)

ozdemirburak avatar ozdemirburak commented on July 1, 2024

Simply, within the App\Http\Controllers\Admin\DashboardController.php, edit constructor.

For instance, change it to something like below:

public function __construct()
{
    if (App::isLocal()) {
        return "Disabled";
    } else {
        $this->period = 30;
        $this->limit = 16;
        $this->end = Carbon::today();
        $this->start = Carbon::today()->subDays($this->period);
        $this->country = env('ANALYTICS_COUNTRY');
        parent::__construct();
    }
}

from laravel-9-simple-cms.

phihung93ap avatar phihung93ap commented on July 1, 2024

Thank you !

from laravel-9-simple-cms.

dezudas avatar dezudas commented on July 1, 2024

I tried the solution it says
FatalErrorException in DashboardController.php line 49:
Class 'App\Http\Controllers\Admin\App' not found

from laravel-9-simple-cms.

ozdemirburak avatar ozdemirburak commented on July 1, 2024

@dezudas You need to import App class after declaring the namespace.

namespace App\Http\Controllers\Admin;

use App;
use App\Base\Controllers\AdminController;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use LaravelAnalytics;

from laravel-9-simple-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.