Generate Code Coverage in Laravel With PCOV
Laravel News
by Laravel News
1h ago
Laravel has every testing tool you'll need to productively write feature and unit tests, giving you more confidence in your code and fewer bugs. Using an out-of-the-box installation, we can immediately see coverage reports with artisan using the --coverage flag: php artisan test --coverage If you don't have PCOV or Xdebug installed yet, you'll get the following error: ERROR Code coverage driver not available. Did you install Xdebug or PCOV? Depending on your operating system and PHP installation, you might need to install PCOV or build it using the installation documentation. I am using ..read more
Visit website
Non-backed Enums in Database Queries and a withSchedule() bootstrap method in Laravel 11.1
Laravel News
by Laravel News
1h ago
This week, the Laravel team released v11.1 with a withSchedule bootstrap method, non-backed Enums in query builder, SES list management options, and more. Laravel 11.1 is the first minor version release since the GA of Laravel 11, released earlier this month. Add withSchedule to Application Bootstrap Nuno Maduro contributed a withSchedule method to the bootstrap/app.php file: ->withSchedule(function ($schedule) { $schedule->command('backup:database')->daily(); }) List management options added to SES Mail Transport Ariful Alam contributed the ability to use SES's subscription ma ..read more
Visit website
Laravel Pint --bail Flag
Laravel News
by Laravel News
1d ago
With this week's v1.15.0 release of Laravel Pint, a new --bail flag was introduced. The bail flag stops Laravel pint execution on the first failure like Pest: This flag is useful in CI environments or pre-commit hooks to test for code-style errors without fixing them. Hat tip to Nuno Maduro, who submitted the --bail feature in Pull Request #261. It's exciting to see these continuous improvements around the Laravel ecosystem! To get started with Laravel Pint, check out the official documentation. The post Laravel Pint --bail Flag appeared first on Laravel News. Join the Laravel Newsletter to ..read more
Visit website
The Laravel Worldwide Meetup is Today
Laravel News
by Laravel News
2d ago
The next Laravel Worldwide Meetup is today at 16:00 UTC featuring TJ Miller. TJ is going to take us on an AI crash course and show us how to get up and running in a Laravel application with the help of an exciting new package. Visit the official page for complete details and to submit your talk for a future meetup. The post The Laravel Worldwide Meetup is Today appeared first on Laravel News. Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox ..read more
Visit website
Cache Routes with Cloudflare in Laravel
Laravel News
by Laravel News
3d ago
The Cloudflare Cache package for Laravel provides cacheable routes, allowing you to serve millions of requests for static pages efficiently. You can define a group of cacheable routes with the Laravel router, including tags. This package makes it easy to start caching with Cloudflare using the Route::cache() method: Route::cache(tags: ['tag1', 'tag2'], ttl: 600)->group(function () { Route::get('/content_with_tags', function () { return 'content'; }); }); Route::cache(tags: ['staticPages'])->group(function () { // }); This package gives you APIs to purge all conten ..read more
Visit website
Learn how to manage timezones in your Laravel Apps
Laravel News
by Laravel News
6d ago
In this video, Ben Holmen teaches us how to manage timezones in your Laravel apps. Some of the highlights include: Store all dates and times in UTC Define a default application Timezone Use Carbon macros for conversions Either automatically or manually, allow the user to select their timezone Here are the code samples used in the video: In Application Timezone Macro Carbon::macro('inApplicationTimezone', function() { return $this->tz(config('app.timezone_display')); }); In User Timezone Macro Carbon::macro('inUserTimezone', function() { return $this->tz(auth()->user()?->timez ..read more
Visit website
"Can I PHP?" Raycast Extension
Laravel News
by Laravel News
6d ago
The Can I PHP? Raycast extension by Diana Scharf lets you check if a certain function or method is available in different versions of PHP. You can see which versions are supported and the deprecation status at a glance: If you hit Enter, you get a helpful details page from the caniphp.com project. The Can I PHP API is like caniuse.com, but for PHP. The alternative to this extension is manually looking up the PHP documentation and finding when something was introduced; for example, here's the uft8_decode documentation: To get started with this extension, you can search the store for "Can I P ..read more
Visit website
Introducing the Context Facade in Laravel
Laravel News
by Laravel News
1w ago
Laravel added a new Context service to define contextual data to the current request. Context data is included in all log entries for that request, and queued jobs will also retain that same data. Using contextual data allows you to easily trace back code execution for a given request and any distributed flows in your application: // In a middleware... Context::add('hostname', gethostname()); Context::add('trace_id', (string) Str::uuid()); // In a controller... Log::info('Retrieving commit messages for repository [{repository}].', [ 'repository' => $repo, ]); Http::get('https://git ..read more
Visit website
Easily create complex database queries with the Query Enrich Package
Laravel News
by Laravel News
1w ago
Laravel Query Enrich is designed to easily create complex database queries in Laravel without having to write complicated SQL code. Here are some examples taken from the readme: Example of fetching orders placed in the last 7 days With Laravel Query Enrich $recentOrders = DB::table('orders') ->where(c('created_at'), '>=', QE::subDate(QE::now(), 7, Unit::DAY)) ->get(); Without Laravel Query Enrich $recentOrders = DB::table('orders') ->whereRaw('created_at >= NOW() - INTERVAL ? DAY', 7) ->get(); Raw Query SELECT * FROM `orders` WHERE `created_at` >= NOW ..read more
Visit website
Launch your Startup Fast with LaraFast
Laravel News
by Laravel News
1w ago
LaraFast is a powerful Laravel boilerplate equipped with Jetstream, Tailwind, Inertia.js, and Vue. It streamlines your SaaS app development by providing ready-to-go components for Payments, Admin, Blog, SEO, and more. This allows you to launch your projects in minutes, saving you both time and money. Focus on idea, and leave the boring stuff to LaraFast This Laravel Boilerplate comes with built in features, to help you save your time and money each time you start a new project. Payments. Plan Checkout Sessions, Single Product Purchases, Customer Portal, Webhook Handling. All out of the box w ..read more
Visit website

Follow Laravel News on FeedSpot

Continue with Google
Continue with Apple
OR