Update ImportPostController

This commit is contained in:
Daniel Supernault 2023-06-26 05:38:29 -06:00
parent 6fd53a3001
commit fe6123c820
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
3 changed files with 8 additions and 1 deletions

View file

@ -78,7 +78,7 @@ class ImportPostController extends Controller
return ImportStatus::collection(
ImportPost::whereProfileId($request->user()->profile_id)
->whereNotNull('status_id')
->has('status')
->cursorPaginate(9)
);
}

View file

@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Status;
class ImportPost extends Model
{
@ -14,4 +15,9 @@ class ImportPost extends Model
'creation_date' => 'datetime',
'metadata' => 'json'
];
public function status()
{
return $this->hasOne(Status::class, 'id', 'status_id');
}
}

View file

@ -5,6 +5,7 @@ namespace App\Observers;
use App\Status;
use App\Services\ProfileStatusService;
use Cache;
use App\Models\ImportPost;
use App\Services\ImportService;
class StatusObserver