I'm looking for a solution for better code navigation within routes definition in PhpStorm.
Using "array convention":
Route::get('endpoint', [Controller::class, 'get']);
Route::put('endpoint', [Controller::class, 'put']);
I can quickly jump to get or put methods from an editor. However, I want to use Route::controller more often:
Route::controller(Controller::class)->group(function() {
Route::get('endpoint', 'get');
Route::put('endpoint', 'put');
});
But this solution allows me to jump to controller class only, not to methods directly.
I have enabled Laravel support in settings. PhpStorm 2022.2.
[Controller::class, 'put'] -- this is generic PHP stuff, not linked to any framework and therefore such navigation is provided by PhpStorm core.
However using Route::controller(Controller::class) grouping is specific to Laravel. PhpStorm does not provide any Laravel-specific support (excluding Blade files). Therefore such navigation should be coming from a Laravel specific plugin.
The original Laravel plugin is no longer compatible with the 2022.2 version: the latest version was released like 3 years ago (back in 2019) and its GitHub repo is in archived/read-only state now ("This repository has been archived by the owner. It is now read-only.").
I suggest you check Laravel Idea plugin instead. It supports such navigation. Please note: it's a PAID plugin, but it is in active development, has many features (much more than the original Laravel plugin) and well worth the money for devs using Laravel framework.
Related
I am new with OctoberCMS. There are few tutorials in the internet. May I ask what is the best setup may I use or possible setup may I use with this web tech stacks?
We have a project and the requirement is we need to use octobercms so that's why we have to used this octobercms.
Possible Setup:
Micro Service Setup?
Two seperate folder for OctoberCMS and Vue.js. The communication would be an API Request calls.
Then for the deployment part for the production, we will use the dist folder from Vue.js Folder. I'm not 100% sure but I think this will be my initial thought that will be possible.
May I ask for any suggestions or clarifications on what will I use project setup. Thank you.
While it would be entirely possible to have two separate web properties with October providing the API, you can also just use Vue within an October CMS theme itself. See https://github.com/scottbedard/vuetober for more information on doing that.
If your project is more of a traditional CMS requirement then I would recommend at least trying the Vuetober approach. If it's a lot more complex and is mostly utilizing October for its powerful backend features, then the API-only approach could work fine too.
The main reason you'd want to go with running vuetober is if you were going to be utilizing the AJAX framework provided by October. You can still technically use it even when October is being run as a headless CMS just providing an API, but it gets more complicated with CORS and some other stuff you have to setup to make sure it works properly.
I have a question. How do you handle versioning and breaking changes (Especially database changes) in your Laravel applications? Ill try to explain a little why this is an issue for me.
Right now the only real versioning we did in our Laravel application was in the API's. We just used a new version prefix for the api calls and linked them to the correct controller based on the version. (e.g. prefix => v1, controller route => 'Api\V1\FooBarController'. If we had a new version we just made a copy from the old controller and modified it to our liking.
Now our issue. For our next version (v3) we have ALOT of database changes and decided to just make a separate database with a new connection and migrate any needed information over from our old database to the new one. This way we are able to keep everything working for our older API version (v2). But because we have alot of changes in the database we need to change alot in the models too.
Should i also separate my models in different folders with a version prefix? Or im i doing this totally wrong in general? Im a bit lost and would like to hear how you guys handle this.
Thank you in advance.
I found this very popular package on github.
https://github.com/barryvdh/laravel-ide-helper
I've seen this used in several projects I've worked in but I am not sure what the benefits exactly are of this package. If I understand correctly it generates a file in the root of your project with a "clone" of the Laravel Framework. This should help with autocompletion.
I don't see any clear examples in the documentation.
When using with PHPStorm it does suggest autocomplete for methods and properties for facade classes. For instance Mail and DB classes are facades, and when using them, you won't have all the suggestions and also the methods will be highlighted as non existent.
I just want to create custom html with good css form with my own php as backhand code and javascript for validation.. Is there any extension for this?
I have seen few extensions but none of them allows me to add my own php backhand code.
Thanks
If you are not going to use Joomla's framework, then you may as well build the form outside of joomla and insert it into the article via an iframe (you may need to change the editor's permissions to allow you to do this).
It is worth looking into using the framework properly, however, as it does have easy-to-use mail classes and actually makes things easier when you get your head around it.
(Though to answer your actual question - this module appears to allow you to add raw php http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules/3668 )
I am considering php framework Codeigniter & Cakephp for small site I would be developing but I am open to using pretty much any framework does fullfill the following requirements. requirements are:
A simple pre-build user authentication system or login system as a plugin, something long
the lines of php-login-script.
Allows Easy integration with third-part excel/spreadsheet generation library or
has some plugin.
Should support PHP 5.2, hence symfony2 can't be considered
Bonus points if the framework
has integration with twitter
bootstrap
Looking for framework which can fullfill all of the above points, so I can save some time. Else, I would prefer framework which does most of the requirements & would write rest myself.
So, based on above requirements; which php framework/script would you suggest?
CakePHP2
User plugin https://github.com/cakedc/users
Twitter Bootstrap https://github.com/slywalker/TwitterBootstrap
There are plenty of different xls export helpers. Just google it and review them I can not recommend any of them because I have not used them. We have our own but we did not open source it.
Overall I would recommend to use CakePHP2 in any case over Codeigniter. I've recently had to convert a project from CI to Cake and now I know why... ;)
I don't know codeIgniter very well, but for Cakephp I can tell you that:
Authentifiaction is easy to implement.
It's easy to generate xml (which Excel can open), for .xls you'll have to do all by yourself.
supports 5.2
there is a helper for twitter bootstrap, but I've never used it.
For me the deal breaker concerning CodeIgniter is the lack of built-in ORM. You should consider if you need one or not.