Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 6.x Shift #8

Merged
merged 3 commits into from
Sep 5, 2024
Merged

Laravel 6.x Shift #8

merged 3 commits into from
Sep 5, 2024

Conversation

tarsem1234
Copy link
Owner

This pull request includes the changes for upgrading to Laravel 6.x. Feel free to commit any additional changes to the shift-128178 branch.

Before merging, you need to:

  • Checkout the shift-128178 branch
  • Review all pull request comments for additional changes
  • Run composer update (if the scripts fail, try with --no-scripts)
  • Clear any config, route, or view cache
  • Thoroughly test your application (no tests?, no CI?)

If you need help with your upgrade, check out the Human Shifts.

@tarsem1234
Copy link
Owner Author

tarsem1234 commented Sep 4, 2024

❌ Shift could not upgrade the following files since they differed from the default Laravel version. You will need to compare these files against the default Laravel 6 versions and merge any changes:

  • app/Http/Kernel.php
  • resources/lang/en/passwords.php
  • resources/lang/en/validation.php

@tarsem1234
Copy link
Owner Author

tarsem1234 commented Sep 4, 2024

⚠️ Laravel 6.x consolidated references to /home as a constant within the RouteServiceProvider. This makes it easier to maintain and change in a single place.

Shift automated this change, but could not upgrade the following files since they differed from the default Laravel version. You should compare these files against the default Laravel 6 versions and merge this change:

  • app/Http/Middleware/RedirectIfAuthenticated.php

@tarsem1234
Copy link
Owner Author

ℹ️ Laravel 6 changed the default Redis client from predis to phpredis. You may keep using predis by setting REDIS_CLIENT=predis for your environment.

@tarsem1234
Copy link
Owner Author

ℹ️ Shift updated your dependencies for Laravel 6. While many of the popular packages are reviewed, you may have to update additional packages in order for your application to be compatible with Laravel 6. Watch dealing with dependencies for tips on handling any Composer issues.

The following dependencies were updated by a major version and may have their own changes. You may check their changelog for any additional upgrade steps.

The following dependencies are now abandoned. You will need to remove or replace them to complete your upgrade.

@tarsem1234
Copy link
Owner Author

⚠️ In Laravel 6, the update method of the BelongsTo relationship no longer provides mass assignment protection or fires Eloquent events. If you wish to preserve this behavior, you should call update on the model itself.

// no mass assignment protection or events...
$post->user()->update(['foo' => 'bar']);

// mass assignment protection and events...
$post->user->update(['foo' => 'bar']);

Shift found potential uses of the update method in:

  • app/Http/Controllers/Frontend/ContractTools/ContractToolLandlordController.php
  • app/Repositories/Frontend/Access/User/UserRepository.php

@tarsem1234
Copy link
Owner Author

ℹ️ The Eloquent model's toArray() method will now cast any attributes that implement Illuminate\Contracts\Support\Arrayable to an array. While unlikely to impact your application, this change could effect code which relies upon the previous data type or output.

@tarsem1234
Copy link
Owner Author

ℹ️ Laravel 6 now requires Carbon 2. While Shift reviewed your application for common breaking changes, you may want to review the Carbon 2 migration notes for additional changes.

@tarsem1234
Copy link
Owner Author

⚠️ PHPUnit 8 deprecated using assertContains and assertNotContains for strings. These assertions now only handle arrays or Traversable objects.

Shift attempted to convert these assertions where reliable, but detected additional uses you should review and, if the arguments are strings, convert them to the new string assertion methods.

  • tests/Frontend/Routes/LoggedOutRouteTest.php

@tarsem1234
Copy link
Owner Author

tarsem1234 commented Sep 4, 2024

⚠️ Previous versions of Laravel would bind parameters passed to the URL helper methods as placeholder values even if the names mismatched. In Laravel 6, named parameters not matching placeholders are attached to the query string instead.

Shift detected the following route() and action() calls passing named parameters you should review to ensure they match the route placeholder name.

  • app/Http/Controllers/Frontend/ContractTools/ContractToolBuyerController.php
  • app/Http/Controllers/Frontend/ContractTools/ContractToolLandlordController.php
  • app/Http/Controllers/Frontend/ContractTools/ContractToolSellerController.php
  • app/Http/Controllers/Frontend/ContractTools/ContractToolTenantController.php
  • app/Http/Controllers/Frontend/OfferController.php
  • app/Http/Controllers/Frontend/XmlFeedController.php
  • resources/views/frontend/contract_tools/rent/sign_documents/landlord/sign_offers_rent_landlord_partner.blade.php
  • resources/views/frontend/contract_tools/rent/sign_documents/tenant/sign_offers_rent_tenant_partner.blade.php
  • resources/views/frontend/contract_tools/sale/sign_documents/sign_offers_sale_buyer_partner.blade.php
  • resources/views/frontend/contract_tools/sale/sign_documents/sign_offers_sale_seller_partner.blade.php
  • resources/views/frontend/my_documents/documents-for-review-update-by-landlord-rent.blade.php
  • resources/views/frontend/my_documents/documents-for-review-update-by-owner.blade.php
  • resources/views/frontend/my_documents/documents-for-review-update-rent.blade.php
  • resources/views/frontend/my_documents/documents-for-review-update.blade.php
  • resources/views/frontend/my_documents/my-received-document.blade.php
  • resources/views/frontend/my_documents/my-send-document.blade.php
  • resources/views/frontend/my_documents/sent-documents-for-review-update.blade.php
  • resources/views/frontend/offer/recieved_offer_view.blade.php
  • resources/views/frontend/offer/recieved_offer_view_rent.blade.php
  • resources/views/frontend/offer/recieved_offer_view_sale.blade.php
  • resources/views/frontend/offer/sent_offer_rent_view.blade.php
  • resources/views/frontend/offer/sent_offer_sale_view.blade.php
  • resources/views/frontend/offer/sent_offer_view.blade.php
  • resources/views/frontend/property/rents_list.blade.php
  • resources/views/frontend/property/sales_list.blade.php

@tarsem1234
Copy link
Owner Author

ℹ️ Laravel 6 made performance optimizations for integer key types. If you are using a string as your model's primary key, you may set the $keyType property on your model.

/**
 * The "type" of the primary key ID.
 *
 * @var string
 */
protected $keyType = 'string';

@tarsem1234
Copy link
Owner Author

ℹ️ The mandrill and sparkpost mail drivers, as well as the rackspace storage driver were removed in Laravel 6. If you were using these drivers, you may adopt a community maintained package which provides the driver.

@tarsem1234
Copy link
Owner Author

ℹ️ Previous versions of Laravel would retry jobs indefinitely. Beginning with Laravel 6, the php artisan queue:work now tries a job one time by default. If you want to force jobs to be tried indefinitely, you may pass the --tries=0 option.

@tarsem1234
Copy link
Owner Author

⚠️ Laravel 6.x has reached end of life. It no longer receives bug fixes or security updates. Shift recommends continuing to upgrade to the latest version (Laravel 11.x).

For tips on running multiple Shifts effectively, watch upgrading old Laravel applications.

@tarsem1234 tarsem1234 merged commit 05acd66 into dev Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants