anomaly/featured_posts_block-extension
Adds a Featured Posts block extension for Anomaly's Blocks module, making it easy to showcase selected posts with configurable settings and templates. Integrates with the Posts module for quick, flexible content highlights.
composer.json and confirm its require constraints against your project's PyroCMS / Streams Platform version. This is a first-party micro-extension with no dependents, so treat the source as the documentation.composer require anomaly/featured_posts_block-extension
php artisan addon:install anomaly/featured_posts_block-extension
php artisan view:clear && php artisan cache:clear
Verify registration with php artisan addon:list.src/FeaturedPostsBlockExtension.php — the extension class, its $provides slug, and the block/form registration.src/Block/ — the Block class that returns the view and the data (this is where the "featured" query lives).resources/views/ — the render template.resources/lang/ — field labels and block name/description.resources/config/ form definition for the block's admin fields.{{ blocks('home-featured').render()|raw }}
The exact helper depends on your Blocks module version — confirm in the module's own docs/source.vendor/ directly.Block class is the natural seam: return the query result from getData() (or equivalent), and keep the template presentation-only. If you need the data outside a block, inject the Posts repository directly instead of resolving a block:
use Anomaly\PostsModule\Post\Contract\PostRepositoryInterface;
$posts = app(PostRepositoryInterface::class)
->where('featured', true)
->limit(3)
->get();
Replace where('featured', true) with whatever scope/field the package's Block class actually uses.src/ before relying on behavior; expect no changelog or upgrade path.BlockExtension/Block base class contracts changed over Streams Platform releases. If the block type never appears in the admin, check php artisan addon:list, then storage/logs/laravel.log — a signature mismatch or namespace/autoload issue is the usual culprit.php artisan view:clear and php artisan cache:clear, and check whether the block's data method memoizes.storage/framework/views. If an override isn't taking effect, confirm which view path is actually being resolved (namespace vs. filesystem path) before assuming the file was ignored.dd($this->getData()) inside the block class, or resolve the block in php artisan tinker and inspect it. Faster than guessing from rendered HTML.How can I help you explore Laravel packages today?