Migrate to laravel ai sdk (#181)
Also * upgrade to livewire 4 * replace rappsoft tables with filament
This commit is contained in:
+8
-10
@@ -8,7 +8,9 @@ use App\Traits\HasMarketData;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -161,14 +163,10 @@ class Holding extends Model
|
||||
->orderBy('date', 'DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
* Related chats for holding
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function chats()
|
||||
public function chatWithConversation(): MorphOne
|
||||
{
|
||||
return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id);
|
||||
return $this->morphOne(ChatWithConversation::class, 'chatable')
|
||||
->where('user_id', auth()->id());
|
||||
}
|
||||
|
||||
public function scopeWithMarketData($query)
|
||||
@@ -449,7 +447,7 @@ class Holding extends Model
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function qtyOwned(?\Illuminate\Support\Carbon $date = null)
|
||||
public function qtyOwned(?Carbon $date = null)
|
||||
{
|
||||
if ($date == null) {
|
||||
$date = now();
|
||||
@@ -470,8 +468,8 @@ class Holding extends Model
|
||||
* @return void
|
||||
*/
|
||||
public function dailyPerformance(
|
||||
?\Illuminate\Support\Carbon $start_date = null,
|
||||
?\Illuminate\Support\Carbon $end_date = null,
|
||||
?Carbon $start_date = null,
|
||||
?Carbon $end_date = null,
|
||||
) {
|
||||
if ($start_date == null) {
|
||||
$start_date = now();
|
||||
|
||||
Reference in New Issue
Block a user