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 = [ $params = [
// 'index' => 'clients,invoices,client_contacts', // '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' => [ 'body' => [
'query' => [ 'query' => [
'bool' => [ 'bool' => [

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -108,7 +108,7 @@
"symfony/mailer": "7.1.6", "symfony/mailer": "7.1.6",
"symfony/mailgun-mailer": "^7.1", "symfony/mailgun-mailer": "^7.1",
"symfony/postmark-mailer": "^7.1", "symfony/postmark-mailer": "^7.1",
"turbo124/beacon": "^2", "turbo124/beacon": "^3",
"twig/extra-bundle": "^3.18", "twig/extra-bundle": "^3.18",
"twig/intl-extra": "^3.7", "twig/intl-extra": "^3.7",
"twig/markdown-extra": "^3.18", "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "76aa3099a372c88f8afbbca1d30fc30c", "content-hash": "8318e1e4c83e423108e0155e52e26fd8",
"packages": [ "packages": [
{ {
"name": "afosto/yaac", "name": "afosto/yaac",
@ -3037,16 +3037,16 @@
}, },
{ {
"name": "google/apiclient-services", "name": "google/apiclient-services",
"version": "v0.409.0", "version": "v0.410.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git", "url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "8366037e450b62ffc1c5489459f207640acca2b4" "reference": "ef335e912305403aef8a6552cc2101c537b9ebdd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/8366037e450b62ffc1c5489459f207640acca2b4", "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ef335e912305403aef8a6552cc2101c537b9ebdd",
"reference": "8366037e450b62ffc1c5489459f207640acca2b4", "reference": "ef335e912305403aef8a6552cc2101c537b9ebdd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3075,9 +3075,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues", "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", "name": "google/auth",
@ -16537,26 +16537,29 @@
}, },
{ {
"name": "turbo124/beacon", "name": "turbo124/beacon",
"version": "v2.0.4", "version": "v3.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/turbo124/beacon.git", "url": "https://github.com/turbo124/beacon.git",
"reference": "17769e5b29b9a5e9db5fabd896e0af9e64738dbb" "reference": "3a2d4edc82a190230ccabce25a586b01120b5b66"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/17769e5b29b9a5e9db5fabd896e0af9e64738dbb", "url": "https://api.github.com/repos/turbo124/beacon/zipball/3a2d4edc82a190230ccabce25a586b01120b5b66",
"reference": "17769e5b29b9a5e9db5fabd896e0af9e64738dbb", "reference": "3a2d4edc82a190230ccabce25a586b01120b5b66",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"guzzlehttp/guzzle": "^7", "guzzlehttp/guzzle": "^7",
"illuminate/support": "^9.0|^10.0|^11|^12", "illuminate/support": "^11|^12",
"php": "^8", "php": "^8.2|^8.3",
"turbo124/waffy": "^1.0" "turbo124/waffy": "^1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^10.0" "larastan/larastan": "^3.6",
"orchestra/testbench": "^10.6",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -16594,9 +16597,9 @@
"turbo124" "turbo124"
], ],
"support": { "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", "name": "turbo124/waffy",

View File

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