How do I make PHPStorm think my file is in a different directory for Intellisense/completion?

angularjs, laravel, organization, php, phpstorm

Solution

You need to mark `public` folder as Resource Root.

Problem

I am using Laravel (PHP Framework) for my website. In Laravel, code organization is (loosely) as follows ``` /app /views [my base file A].php [my base file B].php [my base file C].php /public /css /js /lib index.php ``` There are actually many folders in `/app` but I only showed the important one I'll be adding to: `/views`. Because of how Laravel organizes things, the `public/index.php` file is used as the main loaded view of the application - but it loads the actual html from one of the `views/[my base file].php` files. So `[my base file A].php` would look like this, for example: ``` <link rel="stylesheet" href="css/Normalize.css" type="text/css" /> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"> <link rel="stylesheet" href="css/out.css" type="text/css" /> ``` where the folder is `css/` because this markup will eventually go into `public/index.php`. I get errors because in this file at `app/views/` there is no `css/` folder. I fear that as I fill these files with a lot of code and references to things in the `public/` folder, I'll get way too many errors for my liking. My example is just `<link>` now but I'll have much more than that. I also need the completion - I'll be using direct AngularJS bindings from $scope, as in `<h3> {{messages.hello}} </h3>` (meaning I'll access a variable in a javascript file and I need the completion to make life easier). So my question is: What I'd like to do is still have all the completion / intellisense / error reporting done on the files in `/views` like the file was in the `/public` folder and already a part of `index.php` ... Does anyone know of a way to do this? Currently I'm thinking something along the lines of moving my code out of the folder, but - It may be bad practice to move these things into a folder designated as public - It may mess up Laravel

Original source