Updates for beacon repo

This commit is contained in:
David Bomba 2025-09-01 14:00:58 +10:00
parent 6d179fcce8
commit d06cddb1a4
13 changed files with 108 additions and 20 deletions

View File

@ -86,7 +86,8 @@ class SearchController extends Controller
$params = [
// 'index' => 'clients,invoices,client_contacts',
'index' => 'clients,invoices,client_contacts,quotes,expenses,credits,recurring_invoices,vendors,vendor_contacts,purchase_orders,projects',
// 'index' => 'clients,invoices,client_contacts,quotes,expenses,credits,recurring_invoices,vendors,vendor_contacts,purchase_orders,projects',
'index' => 'clients_v2,invoices_v2,client_contacts_v2,quotes_v2,expenses_v2,credits_v2,recurring_invoices_v2,vendors_v2,vendor_contacts_v2,purchase_orders_v2,projects_v2',
'body' => [
'query' => [
'bool' => [

View File

@ -133,6 +133,16 @@ class Client extends BaseModel implements HasLocalePreference
use Excludable;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'clients_v2';
}
protected $presenter = ClientPresenter::class;
protected $hidden = [

View File

@ -143,6 +143,16 @@ class Credit extends BaseModel
use MakesReminders;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'credits_v2';
}
protected $presenter = CreditPresenter::class;
protected $fillable = [

View File

@ -102,6 +102,16 @@ class Expense extends BaseModel
use Filterable;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'expenses_v2';
}
protected $fillable = [
'client_id',
'assigned_user_id',

View File

@ -255,6 +255,11 @@ class Invoice extends BaseModel
// return 'invoices_index'; // for when we need to rename
// }
public function searchableAs(): string
{
return 'invoices_v2';
}
public function toSearchableArray()
{
$locale = $this->company->locale();

View File

@ -69,6 +69,16 @@ class Project extends BaseModel
use Filterable;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'projects_v2';
}
protected $fillable = [
'name',
'client_id',

View File

@ -129,6 +129,16 @@ class PurchaseOrder extends BaseModel
use SoftDeletes;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'purchase_orders_v2';
}
protected $hidden = [
'id',
'private_notes',

View File

@ -131,6 +131,16 @@ class Quote extends BaseModel
use MakesInvoiceValues;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'quotes_v2';
}
protected $presenter = QuotePresenter::class;
protected $touches = [];

View File

@ -138,6 +138,16 @@ class RecurringInvoice extends BaseModel
use PresentableTrait;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'recurring_invoices_v2';
}
protected $presenter = RecurringInvoicePresenter::class;
/**

View File

@ -101,6 +101,16 @@ class Vendor extends BaseModel
use AppSetup;
use Searchable;
/**
* Get the index name for the model.
*
* @return string
*/
public function searchableAs(): string
{
return 'vendors_v2';
}
protected $fillable = [
'name',
'assigned_user_id',

View File

@ -108,7 +108,7 @@
"symfony/mailer": "7.1.6",
"symfony/mailgun-mailer": "^7.1",
"symfony/postmark-mailer": "^7.1",
"turbo124/beacon": "^2",
"turbo124/beacon": "^3",
"twig/extra-bundle": "^3.18",
"twig/intl-extra": "^3.7",
"twig/markdown-extra": "^3.18",

35
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "76aa3099a372c88f8afbbca1d30fc30c",
"content-hash": "8318e1e4c83e423108e0155e52e26fd8",
"packages": [
{
"name": "afosto/yaac",
@ -3037,16 +3037,16 @@
},
{
"name": "google/apiclient-services",
"version": "v0.409.0",
"version": "v0.410.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "8366037e450b62ffc1c5489459f207640acca2b4"
"reference": "ef335e912305403aef8a6552cc2101c537b9ebdd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/8366037e450b62ffc1c5489459f207640acca2b4",
"reference": "8366037e450b62ffc1c5489459f207640acca2b4",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ef335e912305403aef8a6552cc2101c537b9ebdd",
"reference": "ef335e912305403aef8a6552cc2101c537b9ebdd",
"shasum": ""
},
"require": {
@ -3075,9 +3075,9 @@
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.409.0"
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.410.0"
},
"time": "2025-06-04T17:28:44+00:00"
"time": "2025-08-26T16:51:06+00:00"
},
{
"name": "google/auth",
@ -16537,26 +16537,29 @@
},
{
"name": "turbo124/beacon",
"version": "v2.0.4",
"version": "v3.0.1",
"source": {
"type": "git",
"url": "https://github.com/turbo124/beacon.git",
"reference": "17769e5b29b9a5e9db5fabd896e0af9e64738dbb"
"reference": "3a2d4edc82a190230ccabce25a586b01120b5b66"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/17769e5b29b9a5e9db5fabd896e0af9e64738dbb",
"reference": "17769e5b29b9a5e9db5fabd896e0af9e64738dbb",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/3a2d4edc82a190230ccabce25a586b01120b5b66",
"reference": "3a2d4edc82a190230ccabce25a586b01120b5b66",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^7",
"illuminate/support": "^9.0|^10.0|^11|^12",
"php": "^8",
"illuminate/support": "^11|^12",
"php": "^8.2|^8.3",
"turbo124/waffy": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"larastan/larastan": "^3.6",
"orchestra/testbench": "^10.6",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11"
},
"type": "library",
"extra": {
@ -16594,9 +16597,9 @@
"turbo124"
],
"support": {
"source": "https://github.com/turbo124/beacon/tree/v2.0.4"
"source": "https://github.com/turbo124/beacon/tree/v3.0.1"
},
"time": "2025-04-16T10:54:18+00:00"
"time": "2025-09-01T02:13:38+00:00"
},
{
"name": "turbo124/waffy",

View File

@ -10,8 +10,7 @@ return [
/*
* The API endpoint for logs
*/
'endpoint' => 'https://app.lightlogs.com/api',
'endpoint' => env('BEACON_API_URL', 'https://app.lightlogs.com/api'), // ,
/*
* Your API key
*/