How to get IDE to recognize methods used by Laravel Routes? (PhpStorm) - laravel

PhpStorm uses yellow font for method names if it detects that the method is in use elsewhere in the app.
It uses a grey font for unused methods.
This is really helpful for identifying stale code.
But PhpStorm doesn't recognize my methods that I am using in the /routes directory since they are called magically from a string.
For example, I am only using the sendPayout method in /routes, but the chargeCustomer is called directly from within another method.
For example, this line in /routes/web.php should ideally force the sendPayout method shown in the screenshot to appear in yellow font.
Route::post('/api/send-offer','StripeController#sendPayout');
Is there any way to get PhpStorm to recognize this, either by changing settings or using a certain plugin?
I am using PhpStorm 2019.3.1, MacOS Catalina version 10.15.2, and Laravel 5.8. I already have the Laravel plugin installed to PhpStorm.

Per #LazyOne's comments, the plugin "Laravel Idea" does solve the recognization issue for all Symfony and Laravel methods that aren't already picked up by PhpStorm's default. I definitely recommend this plugin now that I am using it.

There is special file for this called '.phpstorm.meta'. So you can "map" methods. Read more here: https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html

Related

What is name for the effect of Mac OS's file panels expanded view?

Been trying to find similar component, have not yet find one. I want a component that basically able to expand an object to a panel next to it just like MacOS's file system. I wonder if anyone already know such exist and found it? Since I have no idea what this effect's name to start search from .
I am trying specifically, looking for a reactjs / pure js based visual component does it.
This type of view is known as Miller columns.
You're looking for NSBrowser.
It's kind of deprecated (Apple has never updated it to use views, so you still have to use cells). It's also idiosyncratic and has lots of undocumented behavior.
Enjoy ;)

PhpStorm - undefined class in Joomla project

I want to use PhpStorm on Joomla project but I can not use "Go to Class Declaration" (Ctrl+B) on main Joomla classes. For example JFactory::getApplication().
But with my own functions in custom plugin that option works great.
What it can be wrong there?
I have Joomla support plugin.
I have docblock plugin.
I tried invalidate caches.
Legacy code
You only need that to work on legacy code. With the introduction of namespaces, most classnames have changed.
JFactory is a now non-existent class - it has been removed from the core. For compatibility's sake, a class alias is provided at runtime, so PHP can find the new class instead. PhpStorm (and other IDEs) don't know about those aliases (there are a lot more of them).
Stubbing
To solve the problem, Joomla provides a stub, that tells the IDE where to find the new class. Just run
$ php build/stubGenerator.php
This will generate a stubs.php file in your project's root directory with the proper information.
New code
For new code, don't use those old classnames - use their new name instead. The new classnames make it much more likely, that your new code will run on Joomla! 4.0.

Laravel 5.1 using phpstorm code completion issue

this question may have been asked, but i could not find it so far.
i'm new to laravel (5.1) and phpstorm (v9) and trying a simple controller with a view and route.
I noticed that while typing the code for example:
View::make('someView');
if i ignore the autocomplete (intellisense) and complete the code.
i get a "NotFoundHttpException in RouteCollection.php" error.
But if i apply the suggested autocomplete for example:
Illuminate\Support\Facades\View
it works fine.
May be i've missed some configurations on Laravel or phpstorm or both, may be this issue is in only phpstorm v9. Either ways it sometimes give me a headache, specially as i just started learning.
Btw, even if i've
use Illuminate\Support\Facades\View;
for ever function that i write i still have to apply the autocomplete suggestion.
else i get the same View not found error.
Please let me know if there is a way to fix this.
Thanx
Install barryvdh/laravel-ide-helper package and follow instructions. It will create helper files that will improve you IDE autocomplete for Laravel project.

CKEditor 4 config - relative paths

I have been using CKE 4.3.4 for a while (in conjunction with ASP.NET 4.0) and it is generally working fine. But I am having great trouble in configuring features in config.js where I need to specify a path - for example, for a custom stylesheet file (config.stylesSet) or a custom image browser (config.filebrowserImageBrowseUrl). I have only been able to get this to work by specifying an absolute url - e.g. //ckeditor/customstyles.js. Although this works, I am unhappy having to do so as it makes running my applications in different environments difficult and is also an issue when testing using IIS Express which does not provide a root name. I have seen suggestions elsewhere that I need to set a BASEHREF global variable, but I can't see why I shouldn't be able to do this within config.js itself rather than in some external script tag or whatever. I feel sure that I used to be able to do something similar with FCKEditor or earlier versions of CKEditor, so would be grateful if anyone could remind me of the correct syntax.
Jon

How do i find a xcode system header file?

I've got a Mac project i want to port to IOS but i cannot resolve some classes.
there is no header file included in the source except Cocoa.h which Ios does not
use. What is the method to find the right header file or framework?
The classes are SecExternalFormat, SecExternalItemType and SecKeychainAttrType
The first thing I always do is a Google search. For example, in your case I might have done:
site:developer.apple.com SecKeychainAttrType
That yields this page, and then you know you need Security/Security.h.
If you downloaded the documentation (I think it comes with Xcode) you could also search it offline.
As for why the API has changed, I think that's beyond the scope of your question.

Resources