resources er uit gesloopt
This commit is contained in:
@@ -3,10 +3,6 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\UpdateDynamicRequest;
|
||||
use App\Http\Resources\DynamicResource;
|
||||
use App\Http\Resources\LedgerResource;
|
||||
use App\Http\Resources\MessageResource;
|
||||
use App\Http\Resources\UserResource;
|
||||
use App\Models\Dynamic;
|
||||
use App\Services\ActivityService;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
@@ -23,7 +19,7 @@ class DynamicController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
return Inertia::render('Dynamics/Index', [
|
||||
'dynamics' => DynamicResource::collection($request->user()->dynamics()->get()),
|
||||
'dynamics' => $request->user()->dynamics()->get(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -59,10 +55,10 @@ class DynamicController extends Controller
|
||||
$dynamic->load(['ledgers.media', 'participants', 'chat']);
|
||||
|
||||
return Inertia::render('Dynamics/Show', [
|
||||
'dynamic' => new DynamicResource($dynamic),
|
||||
'ledgers' => LedgerResource::collection($dynamic->ledgers),
|
||||
'participants' => UserResource::collection($dynamic->participants),
|
||||
'messages' => MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(\App\Models\Message::PAGINATION_COUNT)),
|
||||
'dynamic' => $dynamic,
|
||||
'ledgers' => $dynamic->ledgers,
|
||||
'participants' => $dynamic->participants,
|
||||
'messages' => $dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(\App\Models\Message::PAGINATION_COUNT),
|
||||
'can' => [
|
||||
'update' => $request->user()->can('update', $dynamic),
|
||||
],
|
||||
@@ -73,7 +69,7 @@ class DynamicController extends Controller
|
||||
{
|
||||
$this->authorize('view', $dynamic);
|
||||
|
||||
return MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(\App\Models\Message::PAGINATION_COUNT));
|
||||
return $dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(\App\Models\Message::PAGINATION_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +80,7 @@ class DynamicController extends Controller
|
||||
$this->authorize('update', $dynamic);
|
||||
|
||||
return Inertia::render('Dynamics/Settings', [
|
||||
'dynamic' => new DynamicResource($dynamic),
|
||||
'dynamic' => $dynamic,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user