Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": [
"artisan",
"boost:mcp"
]
}
}
}
423 changes: 423 additions & 0 deletions CLAUDE.md

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ to `true`.
If you would like to start a new PHP× group, please check our [Organizers page](/organizers)
for instructions and considerations.

### Adding sponsorship packages

PHP× groups can now display sponsorship information directly on their pages! Visit our
[Sponsorships page](/sponsorships) to learn how to add sponsorship packages to your group
and see best practices for working with sponsors.

## Sponsoring Groups

If you are a company that would like to sponsor PHP and Laravel events, please get in
touch. The best way to do that, right now, is [via the PHP× Discord](https://discord.gg/wMy6Eeuwbu).
In the future, we plan to make it easier to connect groups with sponsors.
If you are a company that would like to sponsor PHP and Laravel events, please visit our
[Sponsorships page](/sponsorships) to see groups currently looking for sponsors and learn
about the benefits of sponsoring PHP× meetups.

You can also connect with organizers directly [via the PHP× Discord](https://discord.gg/wMy6Eeuwbu).

## The PHP× network of sites

Expand Down
42 changes: 26 additions & 16 deletions app/Actions/ListGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,34 @@ public function asController(ActionRequest $request)
{
$groups = $this->handle(include_external: ! $request->boolean('no_external'))
->mapWithKeys(function(Group|ExternalGroup $group) {
return [
$group->domain => [
'domain' => $group->domain,
'name' => $group->name,
'description' => $group->description,
'continent' => $group->continent,
'region' => $group->region,
'timezone' => $group->timezone,
'status' => $group->status,
'frequency' => $group->frequency,
'links' => [
'bluesky' => $group->bsky_url,
'meetup' => $group->meetup_url,
],
'coords' => ['latitude' => $group->latitude, 'longitude' => $group->longitude],
'external' => $group instanceof ExternalGroup,
$data = [
'domain' => $group->domain,
'name' => $group->name,
'description' => $group->description,
'continent' => $group->continent,
'region' => $group->region,
'timezone' => $group->timezone,
'status' => $group->status,
'frequency' => $group->frequency,
'links' => [
'bluesky' => $group->bsky_url,
'meetup' => $group->meetup_url,
],
'coords' => ['latitude' => $group->latitude, 'longitude' => $group->longitude],
'external' => $group instanceof ExternalGroup,
];

// Add sponsorship data for non-external groups
if (! ($group instanceof ExternalGroup) && $group->hasSponsorship()) {
$data['sponsorship'] = [
'enabled' => $group->sponsorships_enabled,
'packages' => $group->sponsorship_packages,
'contact_email' => $group->sponsorship_contact_email,
'description' => $group->sponsorship_description,
];
}

return [$group->domain => $data];
});

return response()->json(['groups' => $groups]);
Expand Down
19 changes: 19 additions & 0 deletions app/Actions/SyncGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ protected function syncConfigWithGroup(string $domain, array $config): Group
'longitude',
]));

$this->syncSponsorship($group, $config);

return $group;
}

Expand All @@ -111,6 +113,23 @@ protected function syncConfigWithExternalGroup(string $domain, array $config): E
return $external_group;
}

protected function syncSponsorship(Group $group, array $config): void
{
if (isset($config['sponsorships'])) {
$sponsorship = $config['sponsorships'];

$group->sponsorships_enabled = (bool) ($sponsorship['enabled'] ?? false);
$group->sponsorship_packages = $sponsorship['packages'] ?? [];
$group->sponsorship_contact_email = $sponsorship['contact_email'] ?? null;
$group->sponsorship_description = $sponsorship['description'] ?? null;
} else {
$group->sponsorships_enabled = false;
$group->sponsorship_packages = [];
$group->sponsorship_contact_email = null;
$group->sponsorship_description = null;
}
}

/** @return Collection<string, Group|ExternalGroup> */
protected function groups(): Collection
{
Expand Down
22 changes: 22 additions & 0 deletions app/Http/Controllers/World/SponsorshipsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Controllers\World;

use App\Models\Group;
use Illuminate\Http\Request;

class SponsorshipsController
{
public function __invoke(Request $request)
{
$groupsWithSponsorship = Group::where('sponsorships_enabled', true)
->whereNotNull('sponsorship_packages')
->where('sponsorship_packages', '!=', '[]')
->orderBy('name')
->get();

return view('world.sponsorships', [
'groupsWithSponsorship' => $groupsWithSponsorship,
]);
}
}
16 changes: 16 additions & 0 deletions app/Models/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class Group extends Model
'custom_open_graph_image',
'latitude',
'longitude',
'sponsorships_enabled',
'sponsorship_packages',
'sponsorship_contact_email',
'sponsorship_description',
'created_at',
];

Expand Down Expand Up @@ -80,6 +84,16 @@ public function isDisbanded(): bool
return GroupStatus::Disbanded === $this->status;
}

public function acceptsSponsorship(): bool
{
return $this->sponsorships_enabled;
}

public function hasSponsorship(): bool
{
return $this->acceptsSponsorship() && ! empty($this->sponsorship_packages);
}

public function mailcoach(): ?Mailcoach
{
if (! isset($this->mailcoach_token, $this->mailcoach_list, $this->mailcoach_endpoint)) {
Expand Down Expand Up @@ -139,6 +153,8 @@ protected function casts(): array
'domain_status' => DomainStatus::class,
'latitude' => 'float',
'longitude' => 'float',
'sponsorships_enabled' => 'boolean',
'sponsorship_packages' => 'array',
];
}

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"fakerphp/faker": "^1.23",
"friendsofphp/php-cs-fixer": "^3.68",
"itsgoingd/clockwork": "^5.3",
"laravel/boost": "^1.0",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
Expand Down
Loading