1234567891011121314151617181920212223 |
- <?php
- namespace App\Http\Controllers\API;
- use App\Http\Controllers\Controller;
- use App\Models\Enums\ActionObjectType;
- use App\Repositories\ActionRepository;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Auth;
- class ActionController extends Controller
- {
- public function history(string $objectType, string $objectId)
- {
- $actionObjectType = ActionObjectType::from($objectType);
- $actionObjectType->modelBuilder()->where("company_id", Auth::user()->company_id)->findOrFail($objectId);
- return $this->success([
- 'data' => ActionRepository::actionWithHistory($actionObjectType, $objectId),
- ]);
- }
- }
|