Alycia  Spinka

Alycia Spinka

1602681259

Laravel 8.10 Released

The Laravel team released 8.10 this week with job chains within batches, database upserts, and the latest new features, fixes, and changes in the 8.x branch.

Job Chains in Batches

Kevin Ullyott contributed job chaining within batches. You can add chaining by passing a sub-array of job classes like so:

$batch = Bus::batch([
    new Test1Job(),
    [
        new Test2Job(),
        new Test3Job(),
        new Test4Job(),
    ]
])->then(function (Batch $batch) {
    Log::info('Test Complete!');
})->name('Test')->dispatch();

Add is() Method to Model Relations

Sébastien Nikolaou contributed the is() and isNot() methods to Eloquent relations without an extra query:

// Before: performs extra query to fetch the user model from the author relation
$post->author->is($user);
$post->author->isNot($user);

// After
$post->author()->is($user);
$post->author()->isNot($user);

Add Upset to Eloquent and Query Builder

Paras Malhotra contributed upserting records, which will bulk insert records and update those with duplicate keys. The first argument is the data to be inserted/updated, and the second argument is the column(s) that uniquely identify a given record:

DB::table('users')->upsert([
    ['id' => 1, 'email' => 'taylor@example.com'],
    ['id' => 2, 'email' => 'dayle@example.com'],
], 'email');

// Or with models
User::upsert([
    ['id' => 1, 'email' => 'taylor@example.com'],
    ['id' => 2, 'email' => 'dayle@example.com'],
], 'email');

A newline method for console IO

Scott Carpenter contributed a newLine() method you can use to output a blank line in Artisan console output:

// What you might do now...
$this->info('');
$this->info('Parsing CSV file');
$this->info('');

// You could already do the following
$this->getOutput()->newLine();

// This feature adds a shortcut
$this->newLine();

// You can specify the number of blank lines
$this->newLine(5);

A canAny() Method for Authorizable Models

Denis Duliçi contributed a canAny method to the Authorizable trait that the User model supports. This allows the following (similar to the blade feature with the same name):

$user->canAny(['permission-one', 'permission-two'])

MailMessage when() and unless() Methods

Kuba Szymanowski contributed new convenience methods to the MailMessage class for when you want to change the mail message conditionally:

public function toMail(User $user)
{
    return (new MailMessage)
        ->when(
            $this->offer->acceptation_comment,
            function(MailMessage $message, $comment) {
                $message->line('Your offer has been rejected with a comment:')
                        ->line($comment);
            },
            function(MailMessage $message) {
                $message->line('Your offer has been rejected.');
            }
        );
}

Release Notes

You can see the full list of new features and updates below and the diff between 8.9.0 and 8.10.0 on GitHub. The following release notes are directly from the changelog:

8.10.0

Added

  • Allow for chains to be added to batches (#34612, 7b4a9ec)
  • Added is() method to 1-1 relations for model comparison (#34693, 7ba2577)
  • Added upsert to Eloquent and Base Query Builders (#34698, #34712, 58a0e1b)
  • Support psql and pg_restore commands in schema load (#34711)
  • Added Illuminate\Database\Schema\Builder::dropColumns() method on the schema class (#34720)
  • Added yearlyOn() method to scheduler (#34728)
  • Added restrictOnDelete method to ForeignKeyDefinition class (#34752)
  • Added newLine() method to InteractsWithIO trait (#34754)
  • Added isNotEmpty method to HtmlString (#34774)
  • Added delay() to PendingChain (#34789)
  • Added ‘multiple_of’ validation rule (#34788)
  • Added custom methods proxy support for jobs ::dispatch() (#34781)
  • Added QueryBuilder::clone() (#34780)
  • Support bus chain on fake (a952ac24)
  • Added missing force flag to queue:clear command (#34809)
  • Added dropConstrainedForeignId to `Blueprint (#34806)
  • Implement supportsTags() on the Cache Repository (#34820)
  • Added canAny to user model (#34815)
  • Added when() and unless() methods to MailMessage (#34814)

Fixed

  • Fixed collection wrapping in BelongsToManyRelationship (9245807)
  • Fixed LengthAwarePaginator translations issue (#34714)

Changed

  • Improve schedule:work command (#34736, bbddba2)
  • Guard against invalid guard in make:policy (#34792)
  • Fixed router inconsistency for namespaced route groups (#34793)

#laravel 8 #laravel #php #web-development

What is GEEK

Buddha Community

Laravel 8.10 Released

I am Developer

1599536794

Laravel 8 New Features | Release Notes - Tuts Make

In this post, i will show you what’s new in laravel 8 version.

#What’s new in Laravel 8?

  • 1 - Change Path Of Default Models Directory
  • 2 - Removed Controllers Namespace Prefix
  • 3 - Enhancements on php artisan serve
  • 4 - Enhanced Rate Limiting
  • 5 - Enhanced on Route Caching
  • 6 - Update on Pagination Design
  • 8 - Dynamic Blade Componenets
  • 7 - Update Syntax for Closure Based Event Listeners
  • 8 - Queueable Model Event Listeners
  • 9 - Maintenance mode: secret access
  • 10 - Maintenance mode: pre-rendered page
  • 11 - Queued job batching
  • 12 - Queue backoff()
  • 13 - Laravel Factory

https://www.tutsmake.com/laravel-8-new-features-release-notes/

#laravel 8 features #laravel 8 release date #laravel 8 tutorial #news - laravel 8 new features #what's new in laravel 8 #laravel 8 release notes

I am Developer

1617089618

Laravel 8 Tutorial for Beginners

Hello everyone! I just updated this tutorial for Laravel 8. In this tutorial, we’ll go through the basics of the Laravel framework by building a simple blogging system. Note that this tutorial is only for beginners who are interested in web development but don’t know where to start. Check it out if you are interested: Laravel Tutorial For Beginners

Laravel is a very powerful framework that follows the MVC structure. It is designed for web developers who need a simple, elegant yet powerful toolkit to build a fully-featured website.

Recommended:-Laravel Try Catch

#laravel 8 tutorial #laravel 8 tutorial crud #laravel 8 tutorial point #laravel 8 auth tutorial #laravel 8 project example #laravel 8 tutorial for beginners

I am Developer

1609729452

Laravel 8 Tutorial For Beginners Step by Step

Recommended:- Laravel Try Catch

#laravel #laravel 8 tutoral #laravel 8 tutorial for beginners #laravel 8 tutorial for beginners step by step #laravel 8 tutorial from scratch

Yogi Gurjar

1600308055

Laravel 8 Form Validation Tutorial

Laravel 8 form validation example. In this tutorial, i will show you how to submit form with validation in laravel 8.

And you will learn how to store form data in laravel 8. Also validate form data before store to db.

How to Validate Form Data in Laravel 8

  1. Step 1 – Install Laravel 8 Application
  2. Step 2 – Configuring Database using Env File
  3. Step 3 – Create Model & Migration File For Form
  4. Step 4 – Create Routes
  5. Step 5 – Creating Controller
  6. Step 6 – Create Blade File For Form
  7. Step 7 – Start Development Server
  8. Step 8 – Run Laravel 8 Form Validation App On Browser

https://laratutorials.com/laravel-8-form-validation-example-tutorial/

#laravel 8 form validation #laravel 8 form validation tutorial #laravel 8 form validation - google search #how to validate form data in laravel 8 #form validation in laravel 8

Laravel 8 PDF Generate Example

Today, we will see Laravel 8 PDF Generate Example.

For generating PDF file we will use Laravel-dompdf package, it is create pdf file and also provide to download file functionalities it is very easy to generate pdf in laravel 8, i will give you example in very simple way to generate pdf file and download in your system.

So, Let’s start and see how to generate pdf in laravel 8.

Laravel 8 PDF Generate Example

https://websolutionstuff.com/post/laravel-8-pdf-generate-example


Read Also : Send Mail Example In Laravel 8

https://websolutionstuff.com/post/send-mail-example-in-laravel-8


Read Also : How To Generate QRcode In Laravel

https://websolutionstuff.com/post/how-to-generate-qrcode-in-laravel


Read Also : How To Generate Barcode In Laravel

https://websolutionstuff.com/post/how-to-generate-barcode-in-laravel

#laravel 8 pdf generate example #laravel 8 #pdf generate #generate pdf in laravel 8 #laravel-dompdf package #how to generate pdf in laravel 8