Adding laravel to an existing project that already runs with laravel on the web - laravel

Im very new to laravel and ive a project on a server that uses laravel.
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
when i tried coppying the project folder to the laravel-created folder i got an error.

Download source code except vendor casus it's extra. Install php and composer. Then use a terminal(cmd in windows) and go to your project and run composer install. Wait till downloading packages complete. For running project type php artisan serve and your project is up. If your project had migrations and I think it has actually, run php artisan migrate before running serve command. Also check .env file in the root of project and change database credentials with your own. Depending on what dbms that project uses, you should install that DBMS too. Good luck

Taking reference to your comment:
i have the source code of a project that runs on laravel. Basicaly i am asking how can i run this source code localy on my pc
Good, that you have a project that runs on Laravel. You should probably consider to move your project to a central place, maybe Github, and from there create a proper workflow for development and further deployment to your (testing, production, ...) systems.
Even if you develop alone it would be a good practice to use git and Github - no, it is not the same
To come back to your original question:
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
You don't need to install a new Laravel into an existing Laravel project. Just take the existing one.

Related

Workaround to install composer on single shared hosting in hostinger

Without understanding that I needed SSH Access to deploy my Laravel 8 project smoothly, I purchased the Single Shared Hosting tier from Hostinger which does not offer SSH Access. I have to install Composer, but most of the tutorials I have seen requires the use of SSH in doing so.
Deploying the project has to be done before tomorrow morning and I still have no idea what to do next. I am new to this.
Follow these steps:
Try to match the PHP version of the server and localhost.
Install composer locally. This will generate all library files inside the project. You can check the 'vendor' folder.
Upload the whole project folder to the server filesystem.

How can I clone, edit & use a 3rd party Laravel plugin

I have scoured the web for hours but I can not seem to wrap my head around this. I am developing a Laravel project where I am using the dependency UniSharp/laravel-settings. However, I have noticed that after upgrading my Laravel version to 6.0, the package breaks. I have figured out what I need to do to make the package work with Laravel 6.0 and now I wish to make the required changes and then use the modified package.
So far, I have cloned the original repository into my own (i.e realnsleo/laravel-settings) and I have cloned it onto my development machine. The trouble is, I don't know how to test whether my changes work. Do I need to setup a fresh Laravel installation to test the package? I noticed the package has it's own composer.json file, should I install those dependencies separate from the installed Laravel project? I am highly confused.
Can someone assist me with a step by step on what I need to do to achieve this? I will highly appreciate it. Thank you.

Clone a Laravel Project

what is the best way to use an exist laravel project to create a new project.I copied my project floder and I renamed it but it does not work
Please, somebody help me!
You will still need to install the dependencies through composer as well as any node dependencies you have.
Run composer update on the new project.
Also make sure your file permissions are correct on the new project.
In my opinion the best way to do this is Version Control System.
Step 1: Create Repo of your existing project
Step 2: Fork your Repo, this will allow to choose another project name and so on
You will be able to use your first Repo as template any time when you will need without copy/paste of files on your local

Laravel 5 package development clarity

Ive been reading a few articles on the net about package development but cant quite wrap my head around the basic setup. Ive written jQuery plugins with releases and published to Bower in the passed so maybe im just not understanding the difference with Laravel.
With jQuery plugin dev I would just exclude my dev required dependancies through bower.json to prevent a person pulling in my dependancies. It seems that with Laravel u create an un-tracked Laravel framework folder and put your package into the vendor folder and track only that with Git? So basically the Laravel project sitting outside of my vendor package is just some files on my PC? Surely I would want to track which version of Laravel the package was developed on?
OR should I create a "base" Laravel repository and create another repository inside the vendor folder so make sure I know which Laravel the package was built on?
Documentation and tutorials are very vague...
Your question looks a little bit confuse. I develop packages for Laravel and the following is a regular way:
Laravel manage its dependencias via composer, take a look into composer.json to get a clue how similiar is with bower.
In order to get yout package compatible with laravel's core you need to implement some interfaces in your package. This package also can manage dependencies via composer.
A package can be created as a repository in different version controls, like Github, BitBucket, Packagist, Cartalyst, private packages repositories, etc. By default laravel pull packages from Packagist, but into composer.json file you can specify another reposository as needed.
When you trigger composer update (this is an equivalent as bower update), this dependencies manager will pull all the packages and download them automatically in vendor/ directory.
How to code your package while testing with laravel? some people do the following, including me:
Install a laravel instance just for package development purpose.
Create a new project (your package project) inside of vendor/project-name following lavavel's package requirements.
Keep working your package from this project location. By this way the changes are reflecting instantly in laravel installation.
Don't forget to commit and push

Laravel, Composer, Git workflow

I am new to Laravel, Laravel Homestead, Composer, and the development workflow associated with commiting changes to a Git repository and then pulling those changes to a development/production server. So far after much trial and error, I have managed to:
Set up my local Homestead environment with vagrant.
Create a new Laravel application
Run Composer to fetch dependencies
Access the application locally.
Create a Git repository for my application, commit changes, and push to an origin master branch.
Clone the repository on my remote server (shared hosting on 1and1) and pull the changes in.
For a long time, I couldn't understand why when I pulled the changes to the remote site, I would get PHP errors, but the local site ran just fine. It came down to the fact that the Laravel .gitignore file was ignoring the /vendor directory, which Laravel requires to function. Some Google-fu searches indicate that some people simply run composer update / (composer install ?) on their production servers. (I don't have access to Composer on my shared hosting server, so I am unable to do this)
My question to the community - what do you feel is the best workflow for my given situation? remove the /vendor directory from the .gitignore file? Something else?
Replies are much appreciated.
It looks like you are using GIT as a deployment tool which I dont think is a good idea.
Composer update/install is just for managing dependecies. Some servers dont allow you to run scripts from console or running them is complicated. In this situation you can run composer locally before deployment and send your code to server with all dependencies.
Here are some things that you should keep in mind when designing your workflow:
Use GIT to keep source code and configurations
Use composer to manage dependecies (downloaded dependencies should't be under version control in your GIT repository. Vendor directory and its contetnt is a dependency too)
For deployment use one of deployment tools eg. https://github.com/rocketeers/rocketeer
use the -f flag to forcefully include the vendor directory while using git add.
You are on the right track here, and many will do what you are doing.
The real trouble comes when you are doing multiple server deployments (load balanced, auto-scaling).
Typically what I've seen is a shell script that you would include and run whenever something happens that would require these commands to be run.
Inside of this shell script would be the commands that you want completed every time a new server instance is booted up.
You can do this with a number of tools for a single server environment as well.
I might look into continuous integration tools like Travis CI, Jenkins, etc. If this is a major headache of yours.
Otherwise, it might be overkill.... then just keep doing what you are doing.
adding the vendor directory to your git repo is against best practices.
This is also a decent option involving webhooks:
http://losstopschade.de/post/96967373358
Look at Deploy Laravel Webapp to 1and1

Resources