Files
2025-10-25 20:11:21 +02:00

2.6 KiB

created, updated, tags
created updated tags
2025-02-12 12:01 2025-07-04 07:27
Laravel/Packages

Install / update

npm uninstall @flareapp/flare-client @flareapp/flare-vue @flareapp/js @flareapp/vite @flareapp/vite-plugin-sourcemap-uploader @flareapp/vue
npm install @flareapp/js @flareapp/vue @flareapp/vite
composer require spatie/laravel-activitylog spatie/laravel-ignition
import {flare} from "@flareapp/js";  
  
flare.beforeSubmit = (report) => {  
  
    // Filter out errors that are not useful  
    if ([  
        'Request failed with status code 401',  
        'Network Error',  
        'Failed to fetch dynamically imported module',  
        'is not a valid JavaScript MIME type',  
        'Unable to preload CSS',  
        'Request aborted',  
'Importing a module script failed.',
    ].some(v => report.message.includes(v))) {  
        return false;  
    }  
  
    // Filter silly bots  
    if ([  
        'adsbot',  
        'googlebot'  
    ].some(v => report.context.request.useragent.includes(v))) {  
        return false;  
    }  
  
    return report;  
};  
  
export default flare;
import {flareVue} from "@flareapp/vue";  
import flare from './plugins/flare';

if (import.meta.env.PROD) {  
    flare.light();  
}

// createApp()
	.use(flareVue)
//. .mount(el)
import flareSourcemapUploader from '@flareapp/vite';
return {  
    plugins: [
	    // bla
		flareSourcemapUploader({  
		    key: env.VITE_FLARE_KEY,  
		}),
	],
};
private function versionStuff(): void  
{  
    \Illuminate\Support\Facades\App::macro('getVersion', function () {  
        if (app()->isLocal()) {  
            return time();  
        }  
  
        if (file_exists(base_path('commit_hash.txt'))) {  
            return trim(file_get_contents(base_path('commit_hash.txt')));  
        }  
  
        return md5(base_path());  
    });  
  
    \Illuminate\Support\Facades\Cache::macro('getVersion', function () {  
        return app()->isLocal() ? time() : \Illuminate\Support\Facades\Cache::remember('version', now()->addDay(), fn() => App::getVersion());  
    });  
  
    \Spatie\LaravelIgnition\Facades\Flare::determineVersionUsing(function () {  
        return \Illuminate\Support\Facades\Cache::getVersion();  
    });  
}  
  
private function startLogBatch(): void  
{  
    if (!\Spatie\Activitylog\Facades\LogBatch::isOpen()) {  
        \Spatie\Activitylog\Facades\LogBatch::startBatch();  
        \Illuminate\Support\Facades\Context::add('batch_uuid', \Spatie\Activitylog\Facades\LogBatch::getUuid());  
    }  
}