{"id":7066,"date":"2022-02-09T15:36:24","date_gmt":"2022-02-09T15:36:24","guid":{"rendered":"https:\/\/www.fastcomet.com\/blog\/?p=7066"},"modified":"2025-12-17T12:53:36","modified_gmt":"2025-12-17T12:53:36","slug":"laravel-9-is-here","status":"publish","type":"post","link":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here","title":{"rendered":"Laravel 9 Comes with the PHP 8 Minimum Version"},"content":{"rendered":"\n<p class=\"has-drop-cap\">Laravel 9 is here after it has been rescheduled from September 2021 to February 9, 2022. It\u2019s the first long-term support (LTS) release to be introduced following the 12-month release cycle. You may be familiar with the fact that Laravel transitioned to yearly releases with the release of Laravel 8. Before that, major versions were released every six months. The goal of this transition is to ease the maintenance burden on the community and challenge the Laravel development team to ship more powerful new features without introducing breaking changes. That\u2019s why they have shipped a variety of robust features to Laravel 8 without breaking backward compatibility.<\/p>\n\n\n\n<p>The commitment to ship great new features during the current release is most likely to lead to future &#8220;major&#8221; releases being mainly used for &#8220;maintenance&#8221; tasks with the likes of upgrading upstream dependencies. All that, of course, can be seen in these release notes.<\/p>\n\n\n\n<div class=\"alert alert-info mb-5\"><p>Focus on building your project and apps and leave the server management to FastComet. With <a href=\"https:\/\/www.fastcomet.com\/laravel-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">FastComet Managed Laravel Hosting<\/a> you have the option to install Laravel applications included in the package, and there are no extra fees applied.<\/p><\/div>\n\n\n\n<p class=\"h4\"><strong>Table of Contents:<\/strong><\/p>\n\n\n\n<ul class=\"nav-list\"><li><a href=\"#h-key-laravel-9-changes-and-additions\">Key Laravel 9 Changes and Additions<\/a><ul><li><a href=\"#h-php-8-is-the-minimum-version-in-laravel-9\">PHP 8 Is the Minimum Version in Laravel 9<\/a><\/li><li><a href=\"#h-new-design-for-routes-list\">New Design for routes:list<\/a><\/li><li><a href=\"#h-new-test-coverage-option\">New Test Coverage Option<\/a><\/li><li><a href=\"#h-new-query-builder-interface\">New Query Builder Interface<\/a><\/li><li><a href=\"#h-php-8-string-functions\">PHP 8 String Functions<\/a><\/li><li><a href=\"#h-from-swiftmailer-to-symfony-mailer\">From SwiftMailer to Symfony Mailer<\/a><\/li><li><a href=\"#h-flysystem-3-x\">Flysystem 3.x<\/a><\/li><li><a href=\"#h-improved-eloquent-accessors-mutators\">Improved Eloquent Accessors\/Mutators<\/a><\/li><li><a href=\"#h-implicit-route-bindings-with-enums\">Implicit Route Bindings With Enums<\/a><\/li><li><a href=\"#h-controller-route-groups\">Controller Route Groups<\/a><\/li><li><a href=\"#h-enum-eloquent-attribute-casting\">Enum Eloquent Attribute Casting<\/a><\/li><li><a href=\"#h-forced-scoped-bindings\">Forced Scoped Bindings<\/a><\/li><li><a href=\"#h-laravel-breeze-api-next-js\">Laravel Breeze API &amp; Next.js<\/a><\/li><li><a href=\"#h-laravel-scout-database-engine\">Laravel Scout Database Engine<\/a><\/li><li><a href=\"#h-full-text-indexes-where-clauses\">Full Text Indexes\/Where Clauses<\/a><\/li><li><a href=\"#h-rendering-inline-blade-templates\">Rendering Inline Blade Templates<\/a><\/li><li><a href=\"#h-soketi-echo-server\">Soketi Echo Server<\/a><\/li><li><a href=\"#h-bootstrap-5-pagination-views\">Bootstrap 5 Pagination Views<\/a><\/li><li><a href=\"#h-improved-ignition-exception-page\">Improved Ignition Exception Page<\/a><\/li><li><a href=\"#h-new-helpers\">New Helpers<\/a><\/li><li><a href=\"#h-the-server-php-file-can-be-removed\">The server.php file Can Be Removed<\/a><\/li><\/ul><\/li><li><a href=\"#h-how-to-install-laravel-9\">How to Install Laravel 9<\/a><\/li><li><a href=\"#h-upgrading-to-laravel-9\">Upgrading to Laravel 9<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading h3\" id=\"h-key-laravel-9-changes-and-additions\">Key Laravel 9 Changes and Additions<\/h2>\n\n\n\n<p>Laravel 9 carries on the torch with the improvements made in Laravel 8.x. The new version introduces improved <code>route:list<\/code> output, Flysystem 3.0, support for Symfony 6.0 components, Symfony Mailer, a Laravel Scout database driver, new Eloquent accessor\/mutator syntax, implicit route bindings via Enums, and a variety of bug fixes and usability improvements. Let\u2019s dive in!<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-php-8-is-the-minimum-version-in-laravel-9\">PHP 8 Is the Minimum Version in Laravel 9<\/h3>\n\n\n\n<p>Since Laravel 9 requires Symfony 6.0 and it has a minimum requirement of <a href=\"https:\/\/www.fastcomet.com\/blog\/php-8-0-available\" target=\"_blank\" rel=\"noreferrer noopener\">PHP 8.0<\/a>, that means Laravel 9 carries this same requirement.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-new-design-for-routes-list\">New Design for <code>routes:list<\/code><\/h3>\n\n\n\n<p>The <code>routes:list<\/code> command has been included in Laravel for a long time now, and one issue that arises sometimes is that if you have huge and complex routes defined, trying to view them in the console can get messy. However, this is getting a makeover, thanks to a <a href=\"https:\/\/github.com\/laravel\/framework\/pull\/40269\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">pull request<\/a> from Nuno Maduro.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-new-test-coverage-option\">New Test Coverage Option<\/h3>\n\n\n\n<p>A new artisan <code>test --coverage<\/code> option will display the test coverage directly on the terminal. It also includes a <code>--min<\/code> option that you can use to indicate the minimum threshold enforcement for test coverage.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-new-query-builder-interface\">New Query Builder Interface<\/h3>\n\n\n\n<p>Thanks to Chris Morrell, Laravel 9 features a new Query Builder Interface. See this <a href=\"https:\/\/github.com\/laravel\/framework\/pull\/37956\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">merged PR<\/a> for all the details.<\/p>\n\n\n\n<p>The lack of a shared interface or inheritance between <code>Query\\Builder<\/code>, <code>Eloquent\\Builder<\/code> and <code>Eloquent\\Relation<\/code> can be tricky, especially for developers who rely on type hints for static analysis, refactoring, or code completion in their IDE:<\/p>\n\n\n\n<pre>return Model::query()<br>-&gt;whereNotExists(function($query) {<br>\/\/ $query is a Query\\Builder<br>})<br>-&gt;whereHas('relation', function($query) {<br>\/\/ $query is an Eloquent\\Builder<br>})<br>-&gt;with('relation', function($query) {<br>\/\/ $query is an Eloquent\\Relation<br>});<\/pre>\n\n\n\n<p>This feature adds a new <code>Illuminate\\Contracts\\Database\\QueryBuilder<\/code> interface and an <code>Illuminate\\Database\\Eloquent\\Concerns\\DecoratesQueryBuilder<\/code> trait that implements the interface in place of the <code>existing __call<\/code> implementation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-php-8-string-functions\">PHP 8 String Functions<\/h3>\n\n\n\n<p>Since PHP 8 is now the minimum, Tom Schlick has submitted a <a href=\"https:\/\/github.com\/laravel\/framework\/pull\/38011\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">PR<\/a> to move to using <code>str_contains()<\/code>, <code>str_starts_with()<\/code>, and <code>str_ends_with()<\/code> functions internally in the <code>\\Illuminate\\Support\\Str<\/code> class.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-from-swiftmailer-to-symfony-mailer\">From SwiftMailer to Symfony Mailer<\/h3>\n\n\n\n<p>Previous releases of Laravel have utilized the <a href=\"https:\/\/swiftmailer.symfony.com\/docs\/introduction.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Swift Mailer<\/a> library to send outgoing emails. Nevertheless, that library is no longer maintained and has been succeeded by Symfony Mailer.<\/p>\n\n\n\n<p>For further info, review the <a href=\"https:\/\/laravel.com\/docs\/master\/upgrade#symfony-mailer\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">upgrade guide<\/a> to learn more about ensuring that your application is compatible with Symfony Mailer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-flysystem-3-x\">Flysystem 3.x<\/h3>\n\n\n\n<p>Laravel 9 upgrades the upstream Flysystem dependency to Flysystem 3.x. Flysystem powers all of the filesystem interactions offered by the <strong>Storage<\/strong> facade.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-improved-eloquent-accessors-mutators\">Improved Eloquent Accessors\/Mutators<\/h3>\n\n\n\n<p>Laravel 9 offers a new way to define Eloquent accessors and mutators. In previous Laravel releases, the only way to define accessors and mutators was by defining prefixed methods on your model like so:<\/p>\n\n\n\n<pre>public function getNameAttribute($value)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;return strtoupper($value);<br>}<br>public function setNameAttribute($value)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;attributes['name'] = $value;<br>}<\/pre>\n\n\n\n<p>However, in Laravel 9, you may define an accessor and mutator using a single, non-prefixed method by type-hinting a return type of <code>Illuminate\\Database\\Eloquent\\Casts\\Attribute<\/code>:<\/p>\n\n\n\n<p>use <code>Illuminate\\Database\\Eloquent\\Casts\\Attribute<\/code>;<\/p>\n\n\n\n<pre>public function name(): Attribute<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;return new Attribute(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get: fn ($value) =&gt; strtoupper($value),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set: fn ($value) =&gt; $value,<br>&nbsp;&nbsp;&nbsp;&nbsp;);<br>}<\/pre>\n\n\n\n<p>Additionally, this new approach to defining accessors caches object values that are returned by the attribute, just like custom cast classes:<\/p>\n\n\n\n<pre>use App\\Support\\Address;<br>use Illuminate\\Database\\Eloquent\\Casts\\Attribute;<br>public function address(): Attribute<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;return new Attribute(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get: fn ($value, $attributes) =&gt; new Address(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$attributes['address_line_one'],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$attributes['address_line_two'],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set: fn (Address $value) =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address_line_one' =&gt; $value-&gt;lineOne,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address_line_two' =&gt; $value-&gt;lineTwo,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],<br>&nbsp;&nbsp;&nbsp;&nbsp;);<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-implicit-route-bindings-with-enums\">Implicit Route Bindings With Enums<\/h3>\n\n\n\n<p>PHP 8.1 introduces support for <a href=\"https:\/\/www.php.net\/manual\/en\/language.enumerations.backed.php\" target=\"_blank\" rel=\"noreferrer noopener\">Enums<\/a>. Laravel 9 introduces the ability to type-hint an Enum on your route definition, and Laravel will only invoke the route if that route segment is a valid&nbsp;<\/p>\n\n\n\n<p>Enum value in the URI. Otherwise, an HTTP 404 Error response will be returned automatically. For example:<\/p>\n\n\n\n<pre>enum Category: string<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;case Dogs = 'dogs';<br>&nbsp;&nbsp;&nbsp;&nbsp;case Cats = 'cats';<br>}<\/pre>\n\n\n\n<p>You may define a route that will only be invoked if the <code>{category}<\/code> route segment is <code>dogs<\/code> or <code>cats<\/code>. Otherwise, an HTTP 404 response will be returned:<\/p>\n\n\n\n<pre>Route::get('\/categories\/{category}', function (Category $category) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return $category-&gt;value;<br>});<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-controller-route-groups\">Controller Route Groups<\/h3>\n\n\n\n<p>Now you have the option to use the controller method for defining the common controller for all routes within the group. When defining the routes, you only need to provide the controller method that they invoke:<\/p>\n\n\n\n<pre>use App\\Http\\Controllers\\OrderController;<br>Route::controller(OrderController::class)-&gt;group(function () {<br>&nbsp;&nbsp;&nbsp;&nbsp;Route::get('\/orders\/{id}', 'show');<br>&nbsp;&nbsp;&nbsp;&nbsp;Route::post('\/orders', 'store');<br>});<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-enum-eloquent-attribute-casting\">Enum Eloquent Attribute Casting<\/h3>\n\n\n\n<div class=\"alert alert-info mb-5\"><p>Note:<br>Enum casting is only available for <a href=\"https:\/\/www.fastcomet.com\/blog\/php-8-1-available\" target=\"_blank\" rel=\"noreferrer noopener\">PHP 8.1<\/a>+.<\/p><\/div>\n\n\n\n<p>Eloquent now allows you to cast your attribute values to PHP enums. To accomplish this, you may specify the attribute and enum you wish to cast in your model&#8217;s <code>$casts<\/code> property array:<\/p>\n\n\n\n<pre>use App\\Enums\\ServerStatus;<br>\/**<br>&nbsp;* The attributes that should be cast.<br>&nbsp;*<br>&nbsp;* @var array<br>&nbsp;*\/<br>protected $casts = [<br>&nbsp;&nbsp;&nbsp;&nbsp;'status' =&gt; ServerStatus::class,<br>];<\/pre>\n\n\n\n<p>After you have defined the cast on your model, the specified attribute will be automatically cast to and from an enum when you interact with the attribute:<\/p>\n\n\n\n<pre>if ($server-&gt;status == ServerStatus::provisioned) {<br>&nbsp;&nbsp;&nbsp;&nbsp;$server-&gt;status = ServerStatus::ready;<br>&nbsp;&nbsp;&nbsp;&nbsp;$server-&gt;save();<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-forced-scoped-bindings\">Forced Scoped Bindings<\/h3>\n\n\n\n<p>In previous Laravel releases, you may wish to scope the second Eloquent model in a route definition such that it must be a child of the previous Eloquent model. For example, consider this route definition that retrieves a blog post by slug for a specific user:<\/p>\n\n\n\n<pre>use App\\Models\\Post;<br>use App\\Models\\User;<br>Route::get('\/users\/{user}\/posts\/{post:slug}', function (User $user, Post $post) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return $post;<br>});<\/pre>\n\n\n\n<p>When using a custom keyed implicit binding as a nested route parameter, Laravel now automatically scopes the query to retrieve the nested model by its parent using conventions to guess the relationship name on the parent. This behavior was only previously supported by Laravel when a custom key was used for the child route binding.<\/p>\n\n\n\n<p>However, in Laravel 9, you may instruct Laravel to scope &#8220;child&#8221; bindings even when a custom key is not provided. To do so, you may invoke the scopeBindings method when defining your route:<\/p>\n\n\n\n<pre>use App\\Models\\Post;<br>use App\\Models\\User;<br>Route::get('\/users\/{user}\/posts\/{post}', function (User $user, Post $post) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return $post;<br>})-&gt;scopeBindings();<\/pre>\n\n\n\n<p>Also, you may instruct an entire group of route definitions to use scoped bindings:<\/p>\n\n\n\n<pre>Route::scopeBindings()-&gt;group(function () {<br>&nbsp;&nbsp;&nbsp;&nbsp;Route::get('\/users\/{user}\/posts\/{post}', function (User $user, Post $post) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $post;<br>&nbsp;&nbsp;&nbsp;&nbsp;});<br>});<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-laravel-breeze-api-next-js\">Laravel Breeze API &amp; Next.js<\/h3>\n\n\n\n<p>The Laravel Breeze starter kit received an &#8220;API&#8221; scaffolding mode and complimentary <a href=\"https:\/\/nextjs.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Next.js<\/a> <a href=\"https:\/\/github.com\/laravel\/breeze-next\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">frontend implementation<\/a>. You may use this starter kit scaffolding to jump-start those Laravel applications that are serving as a backend, Laravel Sanctum authenticated API for a JavaScript frontend.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-laravel-scout-database-engine\">Laravel Scout Database Engine<\/h3>\n\n\n\n<p>If your application interacts with small to medium-sized databases or has a light workload, you may now use Scout&#8217;s &#8220;database&#8221; engine instead of a dedicated search service such as Algolia or MeiliSerach. The database engine will use &#8220;where like&#8221; clauses and full text indexes when filtering results from your existing database to determine the applicable search results for your query.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-full-text-indexes-where-clauses\">Full Text Indexes\/Where Clauses<\/h3>\n\n\n\n<p>When using MariaDB or PostgreSQL, the <code>fullText<\/code> method may now be added to column definitions to generate full text indexes:<\/p>\n\n\n\n<pre>$table-&gt;text('bio')-&gt;fullText();<\/pre>\n\n\n\n<p>Additionally, the <code>whereFullText<\/code> and <code>orWhereFullText<\/code> methods may be used to add full text &#8220;where&#8221; clauses to a query for columns that have full text indexes. These methods will be transformed into the appropriate SQL for the underlying database system by Laravel. For example, a <code>MATCH AGAINST<\/code> clause will be generated for applications utilizing MariaDB:<\/p>\n\n\n\n<pre>$users = DB::table('users')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;whereFullText('bio', 'web developer')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;get();<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-rendering-inline-blade-templates\">Rendering Inline Blade Templates<\/h3>\n\n\n\n<p>Sometimes you may need to transform a raw <strong>Blade template<\/strong> string into valid HTML. You can accomplish that by using the render method provided by the <strong>Blade facade<\/strong>. The render method accepts the Blade template string and an optional array of data to provide to the template:<\/p>\n\n\n\n<pre>use Illuminate\\Support\\Facades\\Blade;<br>return Blade::render('Hello, {{ $name }}', ['name' =&gt; 'Joseph C']);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-soketi-echo-server\">Soketi Echo Server<\/h3>\n\n\n\n<p>Although not exclusive to Laravel 9, Laravel has recently assisted with the documentation of Soketi, a Laravel Echo compatible Web Socket server written for <a href=\"https:\/\/www.fastcomet.com\/blog\/nodejs\">Node.js<\/a>. Soketi provides a great, open source alternative to Pusher and Ably for those applications that prefer to manage their own Web Socket server.<\/p>\n\n\n\n<div class=\"alert alert-info mb-5\"><p>Note:<br>Feel free to visit our tutorials if you need to learn <a href=\"https:\/\/www.fastcomet.com\/tutorials\/nodejs\" target=\"_blank\" rel=\"noreferrer noopener\">How to Run Node.js on Shared Hosting<\/a>.<\/p><\/div>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-bootstrap-5-pagination-views\">Bootstrap 5 Pagination Views<\/h3>\n\n\n\n<p>Laravel now includes pagination views built using <a href=\"https:\/\/getbootstrap.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Bootstrap 5<\/a>. To use these views instead of the default Tailwind views, you may call the paginator&#8217;s useBootstrapFive method within the boot method of your <code>App\\Providers\\AppServiceProvider<\/code> class:<\/p>\n\n\n\n<pre>use Illuminate\\Pagination\\Paginator;<br>\/**<br>&nbsp;* Bootstrap any application services.<br>&nbsp;*<br>&nbsp;* @return void<br>&nbsp;*\/<br>public function boot()<br>{<br>&nbsp;&nbsp;&nbsp;Paginator::useBootstrapFive();<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-improved-ignition-exception-page\">Improved Ignition Exception Page<\/h3>\n\n\n\n<p>Ignition, the open source exception debug page created by Spatie, has been redesigned from the ground up. The new and improved Ignition ships with Laravel 9 and includes light\/dark themes, customizable &#8220;open in editor&#8221; functionality, and more.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-new-helpers\">New Helpers<\/h3>\n\n\n\n<p>Laravel 9 introduces two new, convenient helper functions that you may use in your own application.<\/p>\n\n\n\n<h4 class=\"wp-block-heading h5\" id=\"h-str\"><code>str<\/code><\/h4>\n\n\n\n<p>The <code>str<\/code> function returns a new <code>Illuminate\\Support\\Stringable<\/code> instance for the given string. This function is equivalent to the <code>Str::of method<\/code>:<\/p>\n\n\n\n<pre>1$string = str('Taylor')-&gt;append(' Otwell');<br>2&nbsp;<br>3\/\/ 'Taylor Otwell'<\/pre>\n\n\n\n<p>If no argument is provided to the str function, the function returns an instance of Illuminate\\Support\\Str:<\/p>\n\n\n\n<pre>1$snake = str()-&gt;snake('LaravelFramework');<br>2&nbsp;<br>3\/\/ 'laravel_framework'<\/pre>\n\n\n\n<h4 class=\"wp-block-heading h5\" id=\"h-to-route\"><code>to_route<\/code><\/h4>\n\n\n\n<p>The <code>to_route<\/code> function generates a redirect HTTP response for a given named route, providing an expressive way to redirect to named routes from your routes and controllers:<\/p>\n\n\n\n<pre>1return to_route('users.show', ['user' =&gt; 1]);<\/pre>\n\n\n\n<p>If necessary, you may pass the HTTP status code that should be assigned to the redirect and any additional response headers as the third and fourth arguments to the <code>to_route<\/code> method:<\/p>\n\n\n\n<pre>1return to_route('users.show', ['user' =&gt; 1], 302, ['X-Framework' =&gt; 'Laravel']);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading h4\" id=\"h-the-server-php-file-can-be-removed\">The server.php file Can Be Removed<\/h3>\n\n\n\n<p>A minor feature but you can now remove the server.php file from your project, and it will be included inside the framework. This file is only used for php artisan serve.<\/p>\n\n\n\n<h2 class=\"wp-block-heading h3\" id=\"h-how-to-install-laravel-9\">How to Install Laravel 9<\/h2>\n\n\n\n<p>If you wish to try Laravel 9 for development and testing purposes, you can opt to install and run it on your local machine. This last version is not yet available in Softaculous, but it still can be manually installed on FastComet Shared Hosting via Composer.<\/p>\n\n\n\n<p>You may create a new Laravel project by directly using Composer. After creating the application, you can start Laravel&#8217;s local development server using the Artisan CLI&#8217;s serve command:<\/p>\n\n\n\n<pre>composer create-project laravel\/laravel example-app<br>cd example-app<br>php artisan serve<\/pre>\n\n\n\n<p>The other option for you is to install the Laravel Installer as a global Composer dependency:<\/p>\n\n\n\n<pre>composer global require laravel\/installer<br>laravel new example-app<br>cd example-app<br>php artisan serve<\/pre>\n\n\n\n<p>Make sure that you place Composer&#8217;s system-wide vendor bin directory in your <code>$PATH<\/code> so the laravel executable can be located by your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading h3\" id=\"h-upgrading-to-laravel-9\">Upgrading to Laravel 9<\/h2>\n\n\n\n<p>As we already mentioned, Laravel 9 requires PHP 8.0.2 or higher so before you proceed with the upgrade, check if the needed version is set up.<\/p>\n\n\n\n<p>You should also update the following dependencies in your application&#8217;s composer.json file:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>laravel\/framework to ^9.0<\/li>\n\n\n\n<li>nunomaduro\/collision to ^6.0<\/li>\n<\/ul>\n\n\n\n<p>In addition, you need to replace <code>facade\/ignition<\/code> with &#8220;<code>spatie\/laravel-ignition<\/code>&#8220;: &#8220;<code>^1.0<\/code>&#8221; in your application&#8217;s <code>composer.json<\/code> file.<\/p>\n\n\n\n<p>You can access and edit your application\u2019s composer.json file by using the cPanel <a href=\"https:\/\/www.fastcomet.com\/tutorials\/cpanel\/file-manager\" target=\"_blank\" rel=\"noreferrer noopener\">File Manager<\/a>, an <a href=\"https:\/\/www.fastcomet.com\/tutorials\/ftp\" target=\"_blank\" rel=\"noreferrer noopener\">FTP<\/a> client such as <a href=\"https:\/\/www.fastcomet.com\/tutorials\/ftp\/filezilla-upload-files\" target=\"_blank\" rel=\"noreferrer noopener\">FileZilla<\/a>, or through <a href=\"https:\/\/www.fastcomet.com\/tutorials\/getting-started\/ssh-access\" target=\"_blank\" rel=\"noreferrer noopener\">SSH<\/a> (for advanced users only).<\/p>\n\n\n\n<p>As the last step, examine any other third-party packages consumed by your application and verify you are using the proper version for Laravel 9 support.<\/p>\n\n\n\n<h2 class=\"wp-block-heading h3\" id=\"h-final-words\">Final Words<\/h2>\n\n\n\n<p>Laravel keeps pushing the boundaries when it comes to great new improvements in the world of programming. It keeps growing with every new release and making things much less complicated for web application devs all over the world. We can\u2019t see what\u2019s in store with Laravel 10, even though we know it\u2019s a year away.&nbsp;<\/p>\n\n\n\n<p>Share your opinions or even excitement regarding Laravel 9 in the comment section. Happy coding!&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel 9 is here after it has been rescheduled from September 2021 to February 9, 2022. It\u2019s the first long-term support (LTS) release to be introduced following the 12-month release cycle. You may be familiar with the fact that Laravel transitioned to yearly releases with the release of Laravel 8. Before that, major versions were [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":7068,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4724],"tags":[4625,4717,210,4686,4610],"class_list":["post-7066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webdev","tag-javascript","tag-js","tag-laravel","tag-laravel-9","tag-open-source"],"featured_image_src":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","author_info":{"display_name":"Joseph","author_link":"https:\/\/www.fastcomet.com\/blog\/author\/joseph"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Laravel 9 - Everything You Need to Know | FastComet<\/title>\n<meta name=\"description\" content=\"Laravel 9, the first long-term support (LTS) release is here, and along with it comes a wide array of useful new features. Learn how to upgrade to Laravel 9, install it on shared hosting, and code with it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Laravel 9 - Everything You Need to Know | FastComet\" \/>\n<meta property=\"og:description\" content=\"Laravel 9, the first long-term support (LTS) release is here, and along with it comes a wide array of useful new features. Learn how to upgrade to Laravel 9, install it on shared hosting, and code with it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here\" \/>\n<meta property=\"og:site_name\" content=\"FastComet Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-09T15:36:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-17T12:53:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joseph\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Laravel 9 - Everything You Need to Know | FastComet","description":"Laravel 9, the first long-term support (LTS) release is here, and along with it comes a wide array of useful new features. Learn how to upgrade to Laravel 9, install it on shared hosting, and code with it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here","og_locale":"en_US","og_type":"article","og_title":"Laravel 9 - Everything You Need to Know | FastComet","og_description":"Laravel 9, the first long-term support (LTS) release is here, and along with it comes a wide array of useful new features. Learn how to upgrade to Laravel 9, install it on shared hosting, and code with it.","og_url":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here","og_site_name":"FastComet Blog","article_published_time":"2022-02-09T15:36:24+00:00","article_modified_time":"2025-12-17T12:53:36+00:00","og_image":[{"width":1024,"height":620,"url":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","type":"image\/png"}],"author":"Joseph","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joseph","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#article","isPartOf":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here"},"author":{"name":"Joseph","@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/4f2c9600f49c872b8d56996ee3b95035"},"headline":"Laravel 9 Comes with the PHP 8 Minimum Version","datePublished":"2022-02-09T15:36:24+00:00","dateModified":"2025-12-17T12:53:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here"},"wordCount":1894,"commentCount":0,"image":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#primaryimage"},"thumbnailUrl":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","keywords":["javascript","js","Laravel","laravel 9","open source"],"articleSection":["Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here","url":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here","name":"Laravel 9 - Everything You Need to Know | FastComet","isPartOf":{"@id":"https:\/\/www.fastcomet.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#primaryimage"},"image":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#primaryimage"},"thumbnailUrl":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","datePublished":"2022-02-09T15:36:24+00:00","dateModified":"2025-12-17T12:53:36+00:00","author":{"@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/4f2c9600f49c872b8d56996ee3b95035"},"description":"Laravel 9, the first long-term support (LTS) release is here, and along with it comes a wide array of useful new features. Learn how to upgrade to Laravel 9, install it on shared hosting, and code with it.","breadcrumb":{"@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#primaryimage","url":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","contentUrl":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2022\/02\/Laravel_9.0.png","width":1024,"height":620,"caption":"Laravel 9"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fastcomet.com\/blog\/laravel-9-is-here#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fastcomet.com\/blog"},{"@type":"ListItem","position":2,"name":"Laravel 9 Comes with the PHP 8 Minimum Version"}]},{"@type":"WebSite","@id":"https:\/\/www.fastcomet.com\/blog\/#website","url":"https:\/\/www.fastcomet.com\/blog\/","name":"FastComet Blog","description":"FastComet Web Hosting Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fastcomet.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/4f2c9600f49c872b8d56996ee3b95035","name":"Joseph","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1aa84dc2a6398ed73c957bd1de58806d12d44e2956744ed1ae9b435d57822ab7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1aa84dc2a6398ed73c957bd1de58806d12d44e2956744ed1ae9b435d57822ab7?s=96&d=mm&r=g","caption":"Joseph"},"description":"Joseph is part of the FastComet Marketing team. With years of content writing experience behind him, it's one of his favorite activities. Joseph takes part in the SEO of the FastComet website and blog. His goal is to write comprehensive posts and guides, always aiming to help our clients with essential information. Joseph also has a thirst for knowledge and improvement, which makes the hosting environment a perfect place for him.","sameAs":["https:\/\/www.fastcomet.com\/"],"url":"https:\/\/www.fastcomet.com\/blog\/author\/joseph"}]}},"_links":{"self":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/7066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/comments?post=7066"}],"version-history":[{"count":17,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/7066\/revisions"}],"predecessor-version":[{"id":10983,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/7066\/revisions\/10983"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/media\/7068"}],"wp:attachment":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/media?parent=7066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/categories?post=7066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/tags?post=7066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}