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

Asked

Viewed 221 times

7

I have a project (a blog) based on Laravel/Laravel (note that this is the application and not the framework only), but I wish to send to my repository only the contents of the folders app/ and resources/ (native folder of Laravel), this I got, my problem is at the moment of installing the Laravel next to my project, staying only this in 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 you to install together the Laravel/Laravel (the Laravel web application I mentioned earlier) and then the folder app/ and resources/ do Laravel receive the contents of the folders that are in my repository.

I wish to do this way so that if the Laravel/Laravel receive some update when installing run the command composer create-project will already install from the same source, otherwise I would have to make a copy of the contents of the Laravel/Laravel in my repository, so any update in the Laravel/Laravel I’d have to do it manually, which seems impossible to me.

Is there any way to merge my repository with the Laravel/Laravel the moment you execute the command composer create-project [meu vendor]/blog?

2 answers

1


You can make a script for such a, a . sh that runs Composer create-project, downloads your repository and leaves it for you to resolve code conflicts, or else compare to the base repository with git and apply the deltas of the files in your project, but I don’t see why to do it.

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

The application code is just a skeleton for you to start your project. What really counts are the components of the framework (Laravel/framework), these yes need to be updated and working. You can even build your base from scratch or use another approach, as is the case with codecasts/Adjustable.

Having this clear, that that code is only a model is easier to realize that that code no longer belongs to the framework, but to your project. In case something happens that forces you to update the base classes, this process will be described in upgrade guide.

  • Really you are right, all the work that will be done would be better to make a manual copy of the "skeleton", so also avoid problems if the skeleton changes shape (as occurred from the Laravel 5.2 to the 5.3).

0

Do you speak Guilherme blzs? What do you want to do is not a modular application? Example: Make within the Laravel framework a folder structure for Admi and another company’s blog folder structure. If that’s the question, there’s a way to do it in the basement. Link to a basic tutorial on how to do this Modules Laravel

Link to a screencast of how to use. Modular applications with Laravel 5

From what I noticed you are doing is doing your application the reverse way, since first you have to create the application and then make 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 English very good Blog Post

  • 1

    Adriano I know you already understand a little the site, but I would like to reinforce, we are a Q&A and not a forum, here the answers should be objective, I recommend you formulate an example and bring the content of the links here editing your answer, thus making it more relevant. We are not even a forum by far, so please take the tour to understand http://answall.com/tour and then read Help http://answall.com/help/answering, take it as a constructive criticism. Thank you for understanding.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.