The essential news about content management systems and mobile technology. Powered by Perfect Publisher and XT Search for Algolia.
The News Site publishes posts to the following channels: Facebook, Instagram, Twitter, Telegram, Web Push, Tumblr, and Blogger.
The internet is rife with small annoyances, which often lead to breakthroughs in user experience. For example, needing to hit “refresh” or “next page” led to infinite scroll, which is now baked into our media consumption habits.
Today, we’re excited to share a new feature in the desktop editor and Jetpack mobile app that eliminates one of those small annoyances and makes it a breeze to upload media to your WordPress posts and pages.
While working in the editor on your laptop or desktop device, you can now seamlessly add photos directly from your phone.
Here’s how to do it:
Check it out in action below:
We hope this will inspire you to snap even more photos and share them with the world.
Get the appRead more https://wordpress.com/blog/2024/04/04/fast-media-uploads/
In this article, Gabriele Bellini discusses the need for a modern approach to WordPress plugin development. He highlights the stagnation of PHP coding standards within WordPress compared to advancements in PHP and other frameworks like Laravel and Symfony.
The author proposes a contemporary methodology focusing on Composer integration, the Singleton pattern, namespace conventions, clean folder structures, and static code analyzers. Key points include utilizing Composer for dependency management, implementing the Singleton pattern for plugin instantiation, disregarding outdated file naming conventions in favor of PSR-4 autoloading, employing namespaces for isolated helper functions, maintaining a modular folder structure, utilizing static code analyzers like PHPStan and adopting wp-env for local development.
The approach presented is based on the author’s extensive experience and aims to enhance the efficiency and quality of WordPress plugin development in line with modern PHP practices.
Read more @ Modern approach to WordPress plugin development
The post Revitalizing WordPress Plugin Development: A Contemporary Approach appeared first on PHP Prefixer Blog.
Laravel Harbor is a CLI tool that allows you to quickly create on-demand preview environments for your app on Laravel Forge. Using this CLI, you can use GitHub actions to automatically deploy your branches when pull requests are created and tear down the deployment from your server when the pull request is merged. Here's an example of a provisioning workflow using GitHub actions (taken from the documentation):
name: preview-provision
on:
pull_request:
types: [opened, edited, reopened, ready_for_review]
jobs:
harbor-provision:
if: |
github.event.pull_request.draft == false &&
contains(github.event.pull_request.title, '[harbor]')
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.1
steps:
- name: Install Harbor via Composer
run: composer global require mehrancodes/laravel-harbor -q
- name: Start Provisioning
env:
FORGE_TOKEN: ${{ secrets.FORGE_API_TOKEN }}
FORGE_SERVER: ${{ secrets.FORGE_SERVER_ID }}
FORGE_GIT_REPOSITORY: ${{ github.repository }}
FORGE_GIT_BRANCH: ${{ github.head_ref }}
FORGE_DOMAIN: harbor.com
run: harbor provision
Once you've configured this CLI to run with GitHub actions, pull requests will get updated comments with test environment details, making it easy to see what your preview environment is for testing a feature:
Other features include:
To get started with Harbor and read the official docs, check out laravel-harbor.com. You'll need to have a Laravel Forge account as well; see Harbor's Prerequisites for details. Also, the CLI's source code is available on GitHub at mehrancodes/laravel-harbor if you want to check it out.
The post Create Preview Deployments on Forge with Laravel Harbor appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/laravel-harbor
This week, the Laravel team released v11.2, which includes a
fluent() support helper, a context() helper, improved handling of a
missing database during a migrate
operation, and
more.
Philo Hermans contributed a fluent()
helper function when working with multi-dimensional arrays. The
Fluent
class has been in the Laravel framework for
quite a while; however, this PR introduces a helper convenience
method to create a fluent object instance:
$data = [
'user' => [
'name' => 'Philo',
'address' => [
'city' => 'Amsterdam',
'country' => 'Netherlands',
]
],
'posts' => [
[
'title' => 'Post 1',
],
[
'title' => 'Post 2',
]
]
];
collect($data)->get('user');
fluent($data)->user;
collect($data)->get('user')['name'];
fluent($data)->get('user.name');
collect(collect($data)->get('posts'))->pluck('title');
fluent($data)->collect('posts')->pluck('title');
json_encode(collect($data)->get('user')['address']);
fluent($data)->scope('user.address')->toJson();
Michael Nabil contributed a convenience
context()
helper function for managing Context. Depending on the arguments passed, you
can either add to context, get the context object, or retrieve it
(with an optional custom default):
// Add user information to the context
context(['user' => auth()->user()]);
// Retrieve the context object
$context = context();
// Retrieve user information from the context
$user = context('user');
// Optional custom default value if not found.
$some_key = context('key_that_does_not_exist', false);
Michael Nabil contributed support for a default value on Context getters:
// Before: Returns null if not found
Context::get('is_user');
Context::getHidden('is_user');
// After: Returns `false` if not found
Context::get('is_user', false); // false
Context::getHidden('is_user', false); // false
Context::get('is_user'); // null
Günther Debrauwer contributed
assertHasChain()
and
assertDoesntHaveChain()
methods:
public function test_job_chains_foo_bar_job(): void
{
$job = new TestJob();
$job->handle();
$job->assertHasChain([
new FooBarJob();
]);
// $job->assertDoesntHaveChain();
}
Dries Vints contributed better database failure
handing (#50836) when running migrate
when a
database isn't created yet, as well as updating the
migrate:fresh
command to streamline the process when a
database does not exist #50838:
If the
migrate:fresh
command is called while there isn't any database created yet, it'll fail when it tries to wipe the database. This PR fixes this by first checking if the migrations table exists and if not, immediately go to the migrate command by skipping the db:wipe command. This will invoke the migrate command flow and subsequently will reach the point where the command will ask the user to create the database.In combination with #50836 this will offer a more seamless experience for people attempting to install Jetstream through the Laravel installer and choosing to not create the database.
The above description is taken from Pull Request #50838.
Dasun Tharanga contributed an update to the framework
TrimStrings
middleware, where invisible characters are
not trimmed during an HTTP request, which can cause issues when
submitting forms. See Pull Request #50832 for details.
You can see the complete list of new features and updates below and the diff between 11.1.0 and 11.2.0 on GitHub. The following release notes are directly from the changelog:
[@param](https://github.com/param)
in some doc block
by @saMahmoudzadeh in https://github.com/laravel/framework/pull/50827get
and
getHidden
on Context
by @michaelnabil230 in https://github.com/laravel/framework/pull/50824serve
Artisan command by @nunomaduro in https://github.com/laravel/framework/pull/50821Middleware::trustHosts(subdomains:
true)
by @axlon in https://github.com/laravel/framework/pull/50877[@throws](https://github.com/throws)
to
doc block for resolve method by @saMahmoudzadeh in https://github.com/laravel/framework/pull/50873assertChain
and assertNoChain
on job instance by @gdebrauwer in
https://github.com/laravel/framework/pull/50858getDefaultNamespace
method
in some classes (class, interface and trait commands) by @saMahmoudzadeh in https://github.com/laravel/framework/pull/50880orderByRaw
in query
before using cursorPaginate
by @ngunyimacharia in https://github.com/laravel/framework/pull/50887The post Use the New Fluent Helper to Work With Multi-dimensional Arrays in Laravel 11.2 appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/laravel-11-2-0
Verbs is an Event Sourcing package for Laravel created by Thunk.dev. It aims to take all the good things about event sourcing and remove as much boilerplate and jargon as possible. Verbs allows you to derive the state of your application from the events that have occurred.
Here is an interview with Daniel Coulbourne, one of the creators of Verbs, that gives details on the project and why you might want to use Event Sourcing:
<iframe width="560" height="315" src="https://www.youtube.com/embed/asv-zcluV5Q?si=YY-gjZ-aSV3hpPaH&start=326" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>Verbs work great for the following...
Instead of knowing just the current state of your app, every change (event) that leads to the current state is stored. This allows for a more granular understanding of how the system arrived at its current state and offers the flexibility to reconstruct or analyze the state at any point in time.
Visit the official Verbs documentation for complete details on the package, a Quickstart guide, and more.
The post Event sourcing in Laravel with the Verbs package appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/event-sourcing-verbs
Page 8 of 1311