-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
2,291 additions
and
1,959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Controllers\Dashboard; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Resources\Collections\DonationCollection; | ||
use App\Models\Donation; | ||
use Illuminate\Http\Request; | ||
use Inertia\Inertia; | ||
use Inertia\Response; | ||
use Spatie\QueryBuilder\QueryBuilder; | ||
|
||
class DonationController extends Controller | ||
{ | ||
public function index(Request $request): Response | ||
{ | ||
return Inertia::render('AdminOng/Donations/Index', [ | ||
'filter' => $request->query('filter'), | ||
'collection' => new DonationCollection( | ||
QueryBuilder::for(Donation::class) | ||
->where('organization_id', auth()->user()->organization_id) | ||
->with('project:id,name,organization_id') | ||
->allowedSorts('created_at', 'amount') | ||
->defaultSorts('-created_at') | ||
->paginate() | ||
->withQueryString() | ||
), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Controllers\Dashboard; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\Organization\UpdateOrganizationRequest; | ||
use App\Http\Resources\Organizations\EditOrganizationResource; | ||
use App\Models\Activity; | ||
use App\Services\OrganizationService; | ||
use Inertia\Inertia; | ||
use Inertia\Response; | ||
|
||
class OrganizationController extends Controller | ||
{ | ||
public function edit(): Response | ||
{ | ||
$organization = auth()->user()->organization; | ||
|
||
return Inertia::render('AdminOng/Organizations/Edit', [ | ||
'organization' => new EditOrganizationResource($organization), | ||
'activity_domains' => $this->getActivityDomains(), | ||
'counties' => $this->getCounties(), | ||
'changes' => Activity::pendingChangesFor($organization) | ||
->get() | ||
->flatMap(fn (Activity $activity) => $activity->properties->keys()) | ||
->unique() | ||
->values(), | ||
]); | ||
} | ||
|
||
public function update(UpdateOrganizationRequest $request) | ||
{ | ||
$organization = auth()->user()->organization; | ||
|
||
$this->authorize('update', $organization); | ||
|
||
OrganizationService::update($organization, $request->validated()); | ||
|
||
return redirect()->route('dashboard.organization.edit') | ||
->with('success', __('organization.messages.update_success')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.