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 11 support #2473

Merged
merged 32 commits into from
May 23, 2024
Merged

Laravel 11 support #2473

merged 32 commits into from
May 23, 2024

Conversation

ifox
Copy link
Member

@ifox ifox commented Feb 13, 2024

Very excited to share that Twill 3 has been successfully tested with Laravel 11! Read about Laravel 11 on Laravel News.

We will need these PRs on our dependencies to be merged and released:

This PR can be tested using the following Composer configuration:

"repositories": [
    {
        "type": "vcs",
        "url": "[email protected]:area17/laravel-translatable.git"
    },
    {
        "type": "vcs",
        "url": "[email protected]:area17/laravel-nestedset.git"
    },
    {
        "type": "vcs",
        "url": "[email protected]:ifox/tags.git"
    },
    {
        "type": "vcs",
        "url": "[email protected]:StevePorter92/laravel-activitylog.git"
    }
],
"require": {
    "php": "^8.2",
    "area17/twill": "dev-laravel-11-support",
    "laravel/framework": "^11.0",
    "laravel/tinker": "^2.9"
},

The main change in Laravel 11 is the streamlined skeleton. When creating a fresh Laravel 11 application, your repository will contains 69 less files than it would on Laravel 10! Read more about this on Laravel News.

I'm personally very excited by the new config directory behavior, which matches the behavior of Twill's configuration file, where you only need to override what you need, and everything else just inherits from the provided defaults.

It looks so good!

app
├── Http
│   ├── Controllers
│   │   └── Twill
│   └── Requests
│       └── Twill
├── Models
├── Providers
│   └── AppServiceProvider.php
├── Repositories
└── View
    └── Components
        └── Twill

bootstrap
├── cache
├── app.php
└── providers.php

config
├── translatable.php
└── twill.php

routes
├── console.php
├── twill.php
└── web.php

@ifox ifox marked this pull request as draft February 13, 2024 02:00
@ifox ifox changed the title Add Laravel 11 support Laravel 11 support Feb 13, 2024
@ifox ifox added type: enhancement New feature or request and removed type: enhancement New feature or request labels Feb 13, 2024
@ifox ifox self-assigned this Feb 26, 2024
@driftingly
Copy link
Contributor

@kfina-planxy
Copy link

I have problems installing this for laravel 11:

my composer.json

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/area17/twill.git",
            "canonical": false
        },
        {
            "type": "vcs",
            "url": "[email protected]:area17/laravel-translatable.git",
            "canonical": false
        },
        {
            "type": "vcs",
            "url": "[email protected]:area17/laravel-nestedset.git",
            "canonical": false
        },
        {
            "type": "vcs",
            "url": "[email protected]:ifox/tags.git",
            "canonical": false
        },
        {
            "type": "vcs",
            "url": "[email protected]:StevePorter92/laravel-activitylog.git",
            "canonical": false
        }
    ],
    "require": {
        "php": "^8.2.0",
        "area17/twill": "dev-laravel-11-support",
        "barryvdh/laravel-dompdf": "^2.0",
        "guzzlehttp/guzzle": "^7.2",
        "inertiajs/inertia-laravel": "^1.0",
        "mongodb/laravel-mongodb": "^4.1.1",
        "laravel-notification-channels/microsoft-teams": "^1.1",
        "laravel/framework": "^11.0",
        "laravel/jetstream": "^5.0",
        "laravel/sanctum": "^4.0",
        "laravel/tinker": "^2.9",
        "orangehill/iseed": "^3.0",
        "spatie/laravel-googletagmanager": "^2.6",
        "spatie/laravel-permission": "^6.0",
        "tightenco/ziggy": "^1.0"
    },

And get the following error

Problem 1
- Root composer.json requires laravel/framework ^11.0 -> satisfiable by laravel/framework[v11.0.0, ..., v11.3.0].
- area17/twill dev-laravel-11-support requires astrotomic/laravel-translatable ^v11.12 || dev-laravel-11-support -> satisfiable by astrotomic/laravel-translatable[v11.12.0, v11.12.1].
- Conclusion: don't install astrotomic/laravel-translatable v11.12.1 (conflict analysis result)
- Root composer.json requires area17/twill dev-laravel-11-support -> satisfiable by area17/twill[dev-laravel-11-support].

Note:
I had to add the canonical: false, because otherwise it didn't want to install because there was a "higher priority" package available.

@driftingly
Copy link
Contributor

@ifox @kfina-planxy, it looks like the remaining packages have been updated 🥳
https://github.com/Astrotomic/laravel-translatable/releases/tag/v11.13.0

@ifox ifox marked this pull request as ready for review May 14, 2024 01:22
ifox and others added 18 commits May 14, 2024 03:28
This is because testbench now defaults to the database cache store instead of file, see orchestral/testbench-core@1bb8919#diff-86a4a158399429a6fc000a17b3a8da05fddb1c0c16aab3d8ef00f6c67cb8154dR28.

Even though our phpunit is configured to use a mysql database, we need that temporary testing database to avoid failing tests because the cache table doesn't exist during the Twill assets build.
This shouldn't be necessary as this should be coming from Twill's default configuration that is merged in Twill's service provider. This wasn't an issue with previous versions. Not sure yet if the issue is coming from Laravel 11, Dusk or Testbench.
For some reason this isn't needed prior to Laravel 11. Still trying to figure out what has changed in the ecosystem that broke our Dusk tests.
Co-Authored-By: Antonio Ribeiro <[email protected]>
@ifox ifox merged commit 34d27bb into 3.x May 23, 2024
12 checks passed
@ifox ifox deleted the laravel-11-support branch May 23, 2024 12:40
@ifox ifox restored the laravel-11-support branch May 26, 2024 14:10
@ifox ifox added impact: high a major issue impact most of users type: enhancement New feature or request labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: high a major issue impact most of users type: enhancement New feature or request
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

3 participants