How to setup auto complete for laravel 5.6 in netbeans - laravel-5

I following step here to try generate my _ide_helper.php. But I found the _ide_helper.php is not working, but it work if I replace the generated _ide_helper to this

I faced the same issue. The cause lies in the generated
public static function if($name, $callback)
Solution:
Delete this function in ide_helper.php
Test Autocomplete (Let Netbeans generate the internal catalogue)
Now you can revert the file and the autocomplete still works
I don't know, why the same function declaration works in the 5.5 file out of the box. Maybe it has to do with the length of the file, maybe a NetBeans bug.

Related

Unable to use Searchable in laravel model

I am trying to use Laravel Scout Searchable into my model but it gives me an error
Undefined type 'Laravel\Scout\Searchable'.
I have already included
use Laravel\Scout\Searchable;
in the code. Could someone please tell me what am I doing wrong here?
I have followed the documentation as is until this point.
After a little bit of tinkering around I found the answer myself.
The error was produced by PHP intelliphense plugin of VS Code. It seems there is a problem with a version of the plugin I used. I downgraded my version one step and now it detects everything correctly.

How to solve the following error in Laravel and How to know the File Path of SessionHandlerInterface?

I started working with Laravel. Faced a FatalErrorException:
Declaration of SessionHandlerInterface::1($save_path, $session_name) must be compatible with SessionHandlerInterface::1($maxlifetime)
in FileSessionHandler.php line 10
It was working yesterday, and as far as I remember, I have not updated anything.
I tried to look into file FileSessionHandler but I can't figure out the problem. I also tried to look for SessionHandlerInterface, but I am not able to find the Interface file.
How can I solve this problem?
Also please tell me the meaning of 1 after scope resolution operator.

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.

ngmin not working in windows

I am trying to minify all js files (start with controllers and app.js). As we know that regular minifier (uglify etc) won't work directly on angularjs files because of module declaration conventions.
So I tried using ngmin for that.
Concatenated all files and then tried using ngmin - but get this error ...
C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\node_modules\esprima\espri
ma.js:3872
throw e;
^
Error: Line 1007: Unexpected token *
at throwError (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\node_mo
dules\esprima\esprima.js:1156:21)
at throwUnexpected (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\no
de_modules\esprima\esprima.js:1213:9)
at parsePrimaryExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\n
gmin\node_modules\esprima\esprima.js:1567:16)
at parseLeftHandSideExpressionAllowCall (C:\Users\Rahul\AppData\Roaming\npm\
node_modules\ngmin\node_modules\esprima\esprima.js:1644:61)
at parsePostfixExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\n
gmin\node_modules\esprima\esprima.js:1703:20)
at parseUnaryExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngm
in\node_modules\esprima\esprima.js:1784:16)
at parseMultiplicativeExpression (C:\Users\Rahul\AppData\Roaming\npm\node_mo
dules\ngmin\node_modules\esprima\esprima.js:1790:20)
at parseAdditiveExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\
ngmin\node_modules\esprima\esprima.js:1807:20)
at parseShiftExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngm
in\node_modules\esprima\esprima.js:1824:20)
at parseRelationalExpression (C:\Users\Rahul\AppData\Roaming\npm\node_module
s\ngmin\node_modules\esprima\esprima.js:1845:16)
I believe the issue is related to running ngmin in windows environment. I shall try it again with Mac - but trying to gauge if anybody faced this issue and able to find any work-around ?
Thanks in advance ...
It looks like this might be related to concatenating. It's most likely not a Windows issue (I've run ngmin on Windows just fine). There's an open issue for this: https://github.com/btford/grunt-ngmin/issues/12.
I know the recommendation is to run it once on a concatenated file, but you might want to try running ngmin prior to concatenation and see what happens. If that ends up fine, try to concatenate afterwards.

Upgrading custom iOS plugins from Cordoba 1.7 to 2.1, how can I find out why they are never loaded?

I've got my plugins converted, or so I think, and registered in Cordova.plist. The method signatures are correct, according to this guide. Nothing has changed on the js side, yet they don't load and just fail silently. Cordova itself is working, onDeviceReady is firing, but my plugins just never get executed. Everything worked fine with 1.7...
I'd like some help to get started on figuring out where they are supposed to be loaded and/or called from js on the obj-c side. Where can I set a breakpoint in the Cordova source to see why it's not executing my plugin?
Where should I begin to look?
I just did exactly this migration. All I can say is that it worked for me if you follow the steps. You also need to follow the steps from the 1.9>2.0 migration.
Since Cordova 2.0, the framework had big changes.
Maybe is better you implements again using the 2.0 rules and, after, only override selector signature. Thus you learn how do plugin in new versions, updating your Cordova skills. :)
Single big change between 2.0 and 2.1 (for plugins)
Support a new plugin method signature (old signature is deprecated):
The new signature is:
- (void) myMethod:(CDVInvokedUrlCommand*)command;
The old (deprecated) signature is:
- (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;

Resources