5

My friends helped me to install composer, laravel I have also downloaded some laravel projects through SVN. I just wanted to start my own another laravel project. After hours spent on reading about it I honestly do not understand how to create a new laravel project in netbeans. After clicking new project there is option of chosing framework like zend or symphony but my laravel is not there. Could someone advide me please?

EDIT: I can see a lot of views on this topic so I will just say that it is only necessary to install composer, do everything according to laravels manual and only open the project through netbeans, not create it there directly.

divHelper11
  • 2,090
  • 3
  • 22
  • 37
  • 1
    You don't need IDE to create project. It's enough to use composer. This might be helpful for you: http://stackoverflow.com/questions/25948560/how-to-install-laravel-5-0/25949281#25949281 – Marcin Nabiałek Nov 17 '15 at 22:02
  • Yeah, with some experience I noticed its easier this way. Thank you :) – divHelper11 Jun 06 '17 at 15:04

4 Answers4

8

The above solution gave me a lot of errors and eventually I gave up, I've found a much cleaner way to setup a minimal Laravel application by using a seed project.

Tested in Netbeans 8.2 (I think it should work on all 8 versions).

  1. Install Composer on your system
  2. Installer the Composer plugin for Netbeans (It's in the plugins menu, under the PHP category).
  3. New Project > PHP Application
  4. Go though the wizard, and setup your project. the last step should be named Composer
  5. In the last step, search (under Token:) for laravel
  6. Select laravel/laravel: The Laravel Framework. and move it to the selected frameworks on the right
  7. Click Finish, and you're Done!

    enter image description here

svarog
  • 9,477
  • 4
  • 61
  • 77
  • 3
    after that , should i build the other files myself or what?? the whole package are in vendor folder but there is not project tree of files, like App , resources, route , artisan file and so on, only an empty index and composer files !!!! – Mohammed Omer Dec 28 '17 at 15:58
  • what about project tree? – Nalawala Murtuza Nov 15 '19 at 05:51
3

If you read the Installation section from the Laravel Docs you'll see that you only need to run a couple of commands to create a new Laravel app. Open a terminal (command prompt if you're on Windows) and type the following commands:

1. Get the Laravel installer:

composer global require "laravel/installer=~1.1"

2. Go to the directory you want to install Laravel in:

cd path/to/directory

3. Then make sure you have added the composer vendor directory to the PATH system variable (instructions) by appending the following (of course, replace [username] in that path with your actual Windows username):

;C:\Users\[username]\AppData\Roaming\Composer\vendor\bin\

4. Create a new Laravel:

laravel new myapp

The last command will create the app in path/to/directory/myapp. Then all you need to do is create a new project and selecting the source folder you just created your Laravel application in:

Setting up a PHP Project in the NetBeans IDE for PHP

Bogdan
  • 43,166
  • 12
  • 128
  • 129
  • Thank you for your answer. Do this mean that I need download laravel for every project separately? My cmd isn't even responding to my commands I dont get it :D – divHelper11 Nov 18 '15 at 10:04
  • After you do these steps now, next time you create a new project just need to run the last command `laravel new anotherapp`, and it will create the app from a local cached version (so no additional download is done, unless there are updates for Laravel). And what do you mean the _"My cmd isn't even responding to my commands"_? Are you getting errors, and if so what are they? – Bogdan Nov 18 '15 at 11:28
  • My cmd window says that "laravel is not recognized as a command" etc. I am not sure how to deal with this. My composer and laravel are already installed, some people helped me to install it at work like half a year ago and im still working on these laravel projects in netbeans at work but now im not sure how to deal with it when i want to start another project on my laptop – divHelper11 Nov 18 '15 at 13:13
  • I've updated my answer with a solution to your _"laravel is not recognized as a command"_ problem. Just make sure you open a new Command Prompt window after you make that change so it picks up the new path. – Bogdan Nov 19 '15 at 20:16
  • Actually i needed to add path to composer at first. Now everything works perfectly. – divHelper11 Nov 20 '15 at 10:19
1
  1. install JDK 15 for Apache Netbeans 12

    install cygwin "by internet" option

    install composer

  2. create and define projects folder in root one (user )

  3. in command prompt : cd path-to your-netbeans-projects

    composer global require laravel/installer

    composer create-project laravel/laravel mockProject

  4. launche IDE, install Nodejs plugin

    file->open project, select your project

  5. if it will ask to resolve something with the project templates .allow that (the project can have yellow exclamation mark over its name, rightclick->resolve project something->ok )

  6. in bar on top Tools->Open in terminal (if is present)

  7. right click on project name and choose Composer-> Add dependency

  8. in search field write laravel , tap Search and in the list below add 2 of barryvdh-*** wait while dependencies get recognized and click Require you can add other dependencies by typing in search field e.g. blade or javascript as needed

  9. type in terminal php path/to/project/folder/artisan serve . Later you can open C:\cygwin64\home\my_user_name\bashrc file put in at the end cd path/to/project/folder string to enable run artisan without path trailing

  10. You should get this in browser: enter image description here

It won't support blade as it looks but its not essential. The essential one is the speed.

Edit I don't use the cygwin anymore. Do things with console instead. Its pretty enough to cd to the root of project and launch php artisan commands so far

CodeToLife
  • 3,672
  • 2
  • 41
  • 29
0

Type this command composer create-project --prefer-dist laravel/laravel name in terminal . Where name is your project name.