diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 42d3fd1c8c..4fb808e128 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -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' => [ diff --git a/app/Models/Client.php b/app/Models/Client.php index 523b0e610f..c764952268 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -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 = [ diff --git a/app/Models/Credit.php b/app/Models/Credit.php index fd946ddf78..8d7f95408b 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -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 = [ diff --git a/app/Models/Expense.php b/app/Models/Expense.php index a0923ff3db..5f4edab67d 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -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', diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 3b6225906e..f14c325143 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -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(); diff --git a/app/Models/Project.php b/app/Models/Project.php index 0033315207..1f7baf1435 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -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', diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index c9e88d636c..c4cbd815d7 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -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', diff --git a/app/Models/Quote.php b/app/Models/Quote.php index af4b9dd957..c3026ea821 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -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 = []; diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 2b87466b80..f03f852e97 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -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; /** diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index a4f1b8e195..42c0fa0187 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -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', diff --git a/composer.json b/composer.json index 1eb1244a93..62f3bf4059 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/composer.lock b/composer.lock index 72ab198289..353120d618 100644 --- a/composer.lock +++ b/composer.lock @@ -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", diff --git a/config/beacon.php b/config/beacon.php index 2ba9017a06..08ce98df4d 100644 --- a/config/beacon.php +++ b/config/beacon.php @@ -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 */