Merge project when using the "create-project composer" command

7

I have a project (a blog) based on laravel / laravel (note that this is the application and not the framework only) , but I want to send to my repository only the contents of the folders app/ and resources/ (folder native to Laravel), this I got, my problem is when installing laravel next to my project, getting only this in the my repository:

.
├── composer.json
├── app
|   ├── BlogHome.php
|   └── Controller.php
└── resources
    └── views
        └── bloghome.blade.php

For example, when I run the command:

composer create-project [meu vendor]/blog

I want to install the laravel / laravel (the Laravel web application I mentioned earlier) and then the app/ and resources/ of Laravel to receive the contents of the folders that are in my repository.

I want to do this so that if random laravel / laravel get some update at the moment that install run the command composer create-project will already install from the same laravel source, otherwise I would have to make a copy of the laravel / laravel content in my repository, so any update on the laravel / laravel I would have to do manually, which seems unfeasible.

Is there any way to merge my repository with the laravel / laravel repository at the time you run the composer create-project [meu vendor]/blog command?

    
asked by anonymous 27.05.2016 / 08:02

2 answers

1

You can make a script for it, a .sh that runs the create-project composer, downloads its repository and lets you resolve code conflicts, or compare to the base repository with git and apply the deltas to the files in your project, but I do not see the reason for doing so.

Only the code that exists inside the app is enough for the application to work? The answer is no. It needs the base application code to work and it is not guaranteed that changes to this base application will be compatible with your code.

The application code is only a skeleton for you to start your project. What really counts are the framework components (laravel / framework), these do need to be updated and working. You can even create your base from scratch or use another approach, such as codecasts / laravel .

Having this clear, that code is just a model, it is easier to realize that code is no longer part of the framework, but rather of your project. In cases where something happens that forces you to update the base classes, this process will be described in the upgrade guide .

    
25.12.2016 / 00:25
0

Speak Guilherme blzs? What you're trying to do is not a modular application? Example: Make inside the Laravel framework a folder structure for admi and another folder structure for a company blog. If this is the question, there is a way to do it in laravel. Link of a basic tutorial on how to do this Laravel Modules

Link to a Screencast how to use it. Modular Applications with Laravel 5

As I realized you are doing is making your application the reverse way, since you first have to create a laravel application and then do the "modulation" of your application within the framework.

I hope this link can help you! Anything is just a question. =)

Link to a post in very good English Blog Post

    
26.10.2016 / 13:02