Skip to content
Merged
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
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

<p align="center">
<a href="https://php-pb.net"><img src="https://img.shields.io/badge/site-php--pb.net-blue?style=flat-square" alt="Site"></a>
<a href="https://t.me/phppb"><img src="https://img.shields.io/badge/telegram-@phppb-blue?style=flat-square&logo=telegram" alt="Telegram"></a>
<a href="https://github.com/php-pb/php-pb.github.io/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
<a href="https://chat.whatsapp.com/JaWCta8t2DF9Af0zgIb8LB?mode=gi_t"><img src="https://img.shields.io/badge/whatsapp-entrar-25D366?style=flat-square&logo=whatsapp&logoColor=white" alt="WhatsApp"></a>
<a href="https://github.com/php-pb/php-pb.github.io/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
<img src="https://img.shields.io/badge/Laravel-12-FF2D20?style=flat-square&logo=laravel" alt="Laravel">
<img src="https://img.shields.io/badge/Livewire-4-FB70A9?style=flat-square" alt="Livewire">
<img src="https://img.shields.io/badge/Filament-5-FDAE4B?style=flat-square" alt="Filament">
<img src="https://img.shields.io/badge/Tailwind-4-06B6D4?style=flat-square&logo=tailwindcss" alt="Tailwind">
</p>

Expand All @@ -23,7 +24,7 @@ A **PHP-PB** é uma comunidade de desenvolvedores PHP do estado da Paraíba, Bra

### O que fazemos

- **Grupo no Telegram** - Discussões diárias sobre PHP, Laravel, dúvidas técnicas
- **Grupo no WhatsApp** - Discussões diárias sobre PHP, Laravel, dúvidas técnicas
- **Meetups & Hangouts** - Encontros presenciais e online com palestras
- **Blog** - Artigos técnicos escritos pela comunidade
- **Vagas** - Oportunidades de emprego compartilhadas
Expand All @@ -38,7 +39,9 @@ A **PHP-PB** é uma comunidade de desenvolvedores PHP do estado da Paraíba, Bra
| **Tailwind CSS** | 4 | Framework CSS utility-first |
| **Alpine.js** | 3 | Interatividade (incluso no Livewire) |
| **MySQL** | 8 | Banco de dados |
| **FilamentPHP** | 5 | Painel administrativo |
| **FilamentPHP** | 5 | Painel administrativo e área de membro |
| **Phosphor Icons** | - | Ícones do design system |
| **Pest** | - | Testes automatizados |

## Estrutura do Projeto

Expand Down Expand Up @@ -151,23 +154,36 @@ npm run build
npm run dev
```

## CI/CD

- **CI** (`.github/workflows/ci.yml`): roda em todo push/PR na `master` - Pint (formatação), Larastan (análise estática) e a suíte de testes Pest.
- **Deploy** (`.github/workflows/deploy.yml`): só dispara ao criar uma tag no formato `v*.*.*`. Builda os assets, empacota a aplicação e publica via SSH/SCP na Hostinger.

```bash
# Disparar um deploy em produção
git tag v1.0.0
git push origin v1.0.0
```

## Comunidades Parceiras

Fazemos parte de uma rede de comunidades PHP do Nordeste:

| Comunidade | Estado | Link |
|------------|--------|------|
| **PHP-PB** | Paraíba | [php-pb.net](https://php-pb.net) |
| **PHP com Rapadura** | Ceará | [phpcomrapadura.org](https://phpcomrapadura.org) |
| **PHP-PE** | Pernambuco | - |
| **PHP-RN** | Rio Grande do Norte | - |
| Comunidade | Estado |
|------------|--------|
| **PHP-PB** | Paraíba |
| **PHP-PI** | Piauí |
| **PHP-MA** | Maranhão |
| **PHP com Rapadura** | Ceará |
| **PHP-PE** | Pernambuco |
| **PHP-RN** | Rio Grande do Norte |

Juntos organizamos o **[PHPeste](https://phpeste.dev)** - a maior conferência PHP do Nordeste brasileiro!

## Links

- [Site Oficial](https://php-pb.net)
- [Telegram](https://t.me/phppb)
- [WhatsApp](https://chat.whatsapp.com/JaWCta8t2DF9Af0zgIb8LB?mode=gi_t)
- [GitHub](https://github.com/php-pb)
- [Twitter/X](https://twitter.com/phppb)
- [Facebook](https://www.facebook.com/groups/php.pb)
Expand Down
29 changes: 29 additions & 0 deletions site_novo/app/Http/Controllers/SitemapController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Http\Controllers;

use App\Models\Post;
use Illuminate\Http\Response;

class SitemapController extends Controller
{
public function index(): Response
{
$posts = Post::published()->orderBy('published_at', 'desc')->get(['slug', 'updated_at']);

$staticRoutes = [
['route' => route('home'), 'priority' => '1.0', 'changefreq' => 'weekly'],
['route' => route('blog.index'), 'priority' => '0.8', 'changefreq' => 'daily'],
['route' => route('events.index'), 'priority' => '0.8', 'changefreq' => 'daily'],
['route' => route('jobs.index'), 'priority' => '0.6', 'changefreq' => 'weekly'],
['route' => route('speakers.index'), 'priority' => '0.5', 'changefreq' => 'monthly'],
];

$xml = view('sitemap', [
'staticRoutes' => $staticRoutes,
'posts' => $posts,
])->render();

return response($xml, 200)->header('Content-Type', 'application/xml');
}
}
10 changes: 10 additions & 0 deletions site_novo/app/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,14 @@ public function getMainImage(): ?string

return $this->main_image_url;
}

public function getExcerpt(int $length = 160): string
{
$text = collect($this->content_blocks ?? [])
->first(fn (array $block) => ($block['type'] ?? null) === 'paragraph' && filled($block['data']['text'] ?? null));

$plainText = trim(html_entity_decode(strip_tags($text['data']['text'] ?? ''), ENT_QUOTES));

return str($plainText)->limit($length)->toString();
}
}
5 changes: 4 additions & 1 deletion site_novo/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
User-agent: *
Disallow:
Disallow: /admin
Disallow: /membro

Sitemap: https://php-pb.net/sitemap.xml
5 changes: 4 additions & 1 deletion site_novo/resources/views/blog/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<x-layouts.app title="Blog - PHP-PB">
<x-layouts.app
title="Blog - PHP-PB"
description="Artigos técnicos sobre PHP, Laravel e o ecossistema de desenvolvimento, escritos pela comunidade PHP da Paraíba."
>
<livewire:landing.header />

<main>
Expand Down
37 changes: 36 additions & 1 deletion site_novo/resources/views/blog/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
<x-layouts.app :title="$post->title . ' - PHP-PB'">
<x-layouts.app
:title="$post->title . ' - PHP-PB'"
:description="$post->getExcerpt() ?: 'Artigo da comunidade PHP da Paraíba.'"
:image="$post->getMainImage()"
type="article"
>
<x-slot:head>
<script type="application/ld+json">
{!! json_encode([
'@'.'context' => 'https://schema.org',
'@type' => 'BlogPosting',
'headline' => $post->title,
'description' => $post->getExcerpt() ?: null,
'image' => $post->getMainImage(),
'datePublished' => $post->published_at?->toIso8601String(),
'dateModified' => $post->updated_at?->toIso8601String(),
'author' => $post->author ? [
'@type' => 'Person',
'name' => $post->author->name,
] : null,
'publisher' => [
'@type' => 'Organization',
'name' => 'PHP-PB',
'logo' => [
'@type' => 'ImageObject',
'url' => asset('images/hero/mascote.png'),
],
],
'mainEntityOfPage' => [
'@type' => 'WebPage',
'@id' => route('blog.show', $post->slug),
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}
</script>
</x-slot:head>

<livewire:landing.header />

<main class="bg-areia">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
class="text-azul-marinho hover:text-azul-principal transition-colors">
<x-phosphor-github-logo class="w-6 h-6" />
</a>
<a href="https://t.me/phppb" target="_blank" rel="noopener" aria-label="Telegram"
<a href="https://chat.whatsapp.com/JaWCta8t2DF9Af0zgIb8LB?mode=gi_t" target="_blank" rel="noopener" aria-label="WhatsApp"
class="text-azul-marinho hover:text-azul-principal transition-colors">
<x-phosphor-telegram-logo class="w-6 h-6" />
<x-phosphor-whatsapp-logo class="w-6 h-6" />
</a>
<a href="https://twitter.com/phppb" target="_blank" rel="noopener" aria-label="Twitter/X"
class="text-azul-marinho hover:text-azul-principal transition-colors">
Expand Down
39 changes: 37 additions & 2 deletions site_novo/resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
@props([
'title' => null,
'description' => 'A PHP PB é a comunidade de desenvolvedores PHP da Paraíba. Conectamos pessoas, compartilhamos conhecimento e fortalecemos o ecossistema PHP no nosso estado.',
'image' => null,
'type' => 'website',
'noindex' => false,
])

@php
$pageTitle = $title ?? config('app.name');
$ogImage = $image ?? asset('images/hero/farol-cena.png');
$canonical = rtrim(config('app.url'), '/').request()->getRequestUri();
@endphp

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="scroll-smooth">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Comunidade PHP da Paraíba - Conectando desenvolvedores, compartilhando conhecimento e fortalecendo a comunidade PHP no estado.">
<meta name="description" content="{{ $description }}">
<link rel="canonical" href="{{ $canonical }}">
@if ($noindex)
<meta name="robots" content="noindex, nofollow">
@endif

<title>{{ $pageTitle }}</title>

<title>{{ $title ?? config('app.name') }}</title>
<!-- Open Graph -->
<meta property="og:type" content="{{ $type }}">
<meta property="og:site_name" content="PHP-PB">
<meta property="og:title" content="{{ $pageTitle }}">
<meta property="og:description" content="{{ $description }}">
<meta property="og:image" content="{{ $ogImage }}">
<meta property="og:url" content="{{ $canonical }}">
<meta property="og:locale" content="pt_BR">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $pageTitle }}">
<meta name="twitter:description" content="{{ $description }}">
<meta name="twitter:image" content="{{ $ogImage }}">

<!-- Favicon -->
<link rel="icon" href="{{ asset('favicon.ico') }}" type="image/x-icon">
Expand All @@ -18,6 +51,8 @@
@vite(['resources/css/app.css', 'resources/js/app.js'])

@livewireStyles

{{ $head ?? '' }}
</head>
<body class="antialiased bg-areia text-preto font-sans">
{{ $slot }}
Expand Down
2 changes: 1 addition & 1 deletion site_novo/resources/views/errors/403.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-layouts.app title="Acesso restrito - PHP-PB">
<x-layouts.app title="Acesso restrito - PHP-PB" description="Você não tem permissão pra acessar esta área do site PHP-PB." :noindex="true">
<livewire:landing.header />

<main class="bg-areia">
Expand Down
2 changes: 1 addition & 1 deletion site_novo/resources/views/errors/404.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-layouts.app title="Página não encontrada - PHP-PB">
<x-layouts.app title="Página não encontrada - PHP-PB" description="A página que você procura não existe ou foi movida." :noindex="true">
<livewire:landing.header />

<main class="bg-areia">
Expand Down
41 changes: 40 additions & 1 deletion site_novo/resources/views/events/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
<x-layouts.app title="Eventos - PHP-PB">
<x-layouts.app
title="Eventos - PHP-PB"
description="Participe dos meetups, workshops e conferências da comunidade PHP da Paraíba. Confira a agenda de próximos eventos."
>
@if ($events->count() > 0)
<x-slot:head>
<script type="application/ld+json">
{!! json_encode(
$events->map(fn ($event) => [
'@'.'context' => 'https://schema.org',
'@type' => 'Event',
'name' => $event->title,
'description' => $event->description,
'startDate' => $event->starts_at->toIso8601String(),
'eventAttendanceMode' => $event->type->value === 'online'
? 'https://schema.org/OnlineEventAttendanceMode'
: 'https://schema.org/OfflineEventAttendanceMode',
'eventStatus' => 'https://schema.org/EventScheduled',
'location' => $event->type->value === 'online' ? [
'@type' => 'VirtualLocation',
'url' => $event->external_url ?? route('events.index'),
] : [
'@type' => 'Place',
'name' => $event->location,
'address' => $event->location,
],
'image' => $event->getBanner(),
'url' => $event->external_url ?? route('events.index'),
'organizer' => [
'@type' => 'Organization',
'name' => 'PHP-PB',
'url' => config('app.url'),
],
])->values(),
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE,
) !!}
</script>
</x-slot:head>
@endif

<livewire:landing.header />

<main>
Expand Down
5 changes: 4 additions & 1 deletion site_novo/resources/views/jobs/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<x-layouts.app title="Vagas - PHP-PB">
<x-layouts.app
title="Vagas - PHP-PB"
description="Vagas de emprego para desenvolvedores PHP compartilhadas pela comunidade e empresas parceiras da PHP-PB."
>
<livewire:landing.header />

<main>
Expand Down
25 changes: 24 additions & 1 deletion site_novo/resources/views/pages/home.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
<x-layouts.app title="PHP-PB - Comunidade PHP da Paraíba">
<x-layouts.app
title="PHP-PB - Comunidade PHP da Paraíba"
description="A PHP PB é a comunidade de desenvolvedores PHP da Paraíba. Conectamos pessoas, compartilhamos conhecimento e fortalecemos o ecossistema PHP no nosso estado desde 2012."
>
<x-slot:head>
<script type="application/ld+json">
{!! json_encode([
'@'.'context' => 'https://schema.org',
'@type' => 'Organization',
'name' => 'PHP-PB',
'alternateName' => 'Comunidade PHP da Paraíba',
'url' => config('app.url'),
'logo' => asset('images/hero/mascote.png'),
'description' => 'Comunidade de desenvolvedores PHP da Paraíba, promovendo meetups, conteúdo e networking desde 2012.',
'sameAs' => [
'https://github.com/php-pb',
'https://chat.whatsapp.com/JaWCta8t2DF9Af0zgIb8LB?mode=gi_t',
'https://twitter.com/phppb',
'https://www.facebook.com/groups/php.pb',
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}
</script>
</x-slot:head>

<livewire:landing.header />

<main>
Expand Down
18 changes: 18 additions & 0 deletions site_novo/resources/views/sitemap.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@foreach ($staticRoutes as $item)
<url>
<loc>{{ $item['route'] }}</loc>
<changefreq>{{ $item['changefreq'] }}</changefreq>
<priority>{{ $item['priority'] }}</priority>
</url>
@endforeach
@foreach ($posts as $post)
<url>
<loc>{{ route('blog.show', $post->slug) }}</loc>
<lastmod>{{ $post->updated_at->toAtomString() }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
@endforeach
</urlset>
5 changes: 4 additions & 1 deletion site_novo/resources/views/speakers/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<x-layouts.app title="Palestrantes - PHP-PB">
<x-layouts.app
title="Palestrantes - PHP-PB"
description="Conheça os palestrantes que já passaram pelos eventos da comunidade PHP da Paraíba."
>
<livewire:landing.header />

<main>
Expand Down
3 changes: 3 additions & 0 deletions site_novo/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
use App\Http\Controllers\EventController;
use App\Http\Controllers\JobListingController;
use App\Http\Controllers\PostController;
use App\Http\Controllers\SitemapController;
use App\Http\Controllers\SpeakerController;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
return view('pages.home');
})->name('home');

Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap');

Route::get('/blog', [PostController::class, 'index'])->name('blog.index');
Route::get('/blog/{slug}', [PostController::class, 'show'])->name('blog.show');

Expand Down
Loading
Loading