Re: issues upgradubg laravel/php apps.

bruce <[email protected]> Sat, 26 Apr 2025 12:51:30 -0400
Newsgroups gmane.comp.php.general
Message-ID <CAP16ngqKxixTvpRhtU7GZyd0P4c+yHJ52K-396OPzkO5MfHN7Q@mail.gmail.com>
Hi.

This continues my Laravel quest. Please ignore if you don't have any use of
laravel, or this isn't your thing. I'm posting for a couple of reasons. 1)
-- While this isn't a php coding issue, laravel is php. 2) I'm trying to
get a basic understanding of how laravel works in setting up (composer
install/composer.json) the basic process, that I haven't yet been able to
find from searching/vids. 3) In the event I resolve what I'm trying to
figure out, posting here, might help others down the road!

Unless you're sitting in a class with someone who knows Laravel, I imagine
a lot of people got to Laravel from php -> looking over github/laravel
apps, and doing a mod of the github apps.

But, from my short time, it appears a lot of github apps are outdated, so
testing them requires jumping into laravel, and probably not really
understanding exactly what/why/how something is happening. (Kind of like
repairing the car.. what's this part for.. do we need it!)

So, for now, I have a test app that my goal is to test.

Doing a straight download from github, and going through the "install
steps" from the repo, developed errs.

So, I created a fresh new laravel app,  which went through the install --
"composer install"  and "worked"

This generated the "composer.json", which has sections that I have no clue
as to exactly what/how/why they exist, or were added. I assume this is a
boilerplate/skeleton of what's needed.

At the same time, I have the initial dir of the github repos/app, with it's
"composer.json" which generated the errs.. I assumed these errs are due to
old packages, etc..

When I compared the two composer.json, there are differences. Focusing on
the "require": section, I was able to use the new/working composer, and
starting with the require section, in the github "composer.json", was able
to go through the files, starting at the beginning, and using the
packagelist app, figure out what/which file version would work with the
new/modified composer.json.  This iterative process was basically my way of
"updating" the github repo/app.

This resulted in a modified composer.json that seemed to work, with a file
that was left out/removed...

However, I'm at the point where I'm looking  at the "scripts" section..

I took the github/repo -- composer.json, and copied the "require" section
from the modified new/fresh composer.json that worked.. and
inserted/replaced it in the composer from the github/app/repo dir..

running this -- composer install/update -- didn't work..
 the dir structure was/is the same files/dirs from the github repos,
although, I assume the composer app modified the files.

It appears the github -- composer.json
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example',
'.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ],

somehow fails.....



whereas the new  --composer.json
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],

so, I'm trying to figureout/understand the "post-autoload-dump"
--ComposerScripts..

stuff..

and what's the diff..
 what should it be.. since I've changed things...
  since I probably have different files in the changed github/test app dir
now..

thoughts/comments are welcome!!

thanks

-bruce


On Sat, Apr 26, 2025 at 6:43 AM bruce <[email protected]> wrote:

> Hi All...
>
> Update on my testing of the github process..
>
> It actually appears that laravel packages can change over time, in terms
> of function, as well as even being abandoned, or having the function
> absorbed in other packages. Ok, if you're immersed within laravel, you
> develop an understanding of these nuances. If, on the other hand, you are
> "new", or trying to test, you can wind up going down a bunch of rabbit
> holes trying to get to a reasonable end point. The primary issue, while the
> 'net, is full of stuff, there's no place where one can be guaranteed of the
> "right/best" answers with a knowledge that you can feel is valid. In other
> words, lots of knowledge, but how does one know it's any good!
>
> That said, I decided to create new test app/shell, get it to "compose
> install" with no errs, and then back fill the items from my test github
> app. I followed this process, and came up with upgraded/versions of some
> apps, and a few that appeared to "no longer be needed". So the process then
> proceeded to the post autoload/dump testing (i guess). Which is where I
> find myself now.
>
>         "post-autoload-dump": [
>             "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
>             "@php artisan package:discover --ansi"
>          (this one works from the new base laravel12 project
>
>         "post-autoload-dump": [
>             "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
>             "@php artisan package:discover"
>         (this is the one from the orig github app...  it seems to err
> out..)
>
>  Right now, I have 0 clue or pointers to how this process gets setup, or
> works, or what it does..or why?
>
> thoughts/pointers...
>
> thanks
>
>
> On Fri, Apr 25, 2025 at 8:32 AM bruce <[email protected]> wrote:
>
>> hi..
>>
>> to begin.. this might be "toppost".. using gmail.. can't yet figure out
>> how to "insert" my reply within the body!
>>
>> that said..
>>
>> After rethinking a bit on what Ashley had mentioned, I've found a few
>> random repos/apps with laravel 12/php 8.3. my goal to be able to get them
>> to "install" -- composer install with no errs..
>>
>> This would give me a "starting basis" (hopefully), and I can build from
>> there, adding additional packages that I have in my "test" apps..
>>
>> This might/should help to narrow down potential issues..
>>
>> Keep in mind, my only reason for doing this.. to be able to actually
>> build/run/view potential apps that have items that I can copy/use in my
>> actual test project that I want to create..
>>
>> If i get to this point, I'd actually have something I could then discuss
>> with devs to refactor/make better for the initial testing..
>>
>> thoughts!
>>
>>
>> On Thu, Apr 24, 2025 at 4:34 PM bruce <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Looking to do a local install of different php/laravel apps, and find a
>>> number of the apps are old, and have issues with m teste server.
>>>
>>> Running ubuntu 22 with php 8.3.
>>>
>>> The issue seems to occur with incompatibilities beyeen the "old"
>>> packages in the app (composer.json) files.
>>>
>>> So, I'm looking to talk to anyone that might have insight ijnto steps to
>>> resolve this issue in the apps.
>>>
>>> I've left msgs to the issue forums, as well as emails to the authors
>>> were possible.
>>>
>>> the test server.. standard digital ocean, ubuntu, etc..
>>>
>>> thanks
>>>
>>>