I don’t know how many times I saw this question asked by many PHP developers. It happens when some developer is not developing in Java actively, need to do some quick codes, and does PHP development regularly. Associative arrays are one of the most used feature (or is it the most?) of PHP.
Though collections are basic java features, and why many of PHP developers cannot readily catch that they can use Maps or Properties collections? It’s mainly because of OOP pattern. Java collections are objects. And many PHP developers are too accustomed to using Non-OOP patterns even if they are coding in a object oriented framework like laravel, or symfony, or zend.
This is a concept might be overlooked by the beginners in Spring framework. When a Bean configuration is loaded in a IoC container, all the beans are constructed by default if you don’t specifically mentioned lazy loading on a bean. So,
I just learned it!
When defining a <bean> in Spring, you have the option of declaring a scope for that bean. For example, To force Spring to produce a new bean instance each time one is needed, you should declare the bean’s scope attribute to be prototype. Similar way if you want Spring to return the same bean instance each time one is needed, you should declare the bean’s scope attribute to be singleton.
The Spring Framework supports following five scopes, three of which are available only if you use a web-aware ApplicationContext.
|singleton||This scopes the bean definition to a single instance per Spring IoC container (default).|
|prototype||This scopes a single bean definition to have any number of object instances.|
|request||This scopes a bean definition to an HTTP request. Only valid in the context of a web-aware Spring ApplicationContext.|
|session||This scopes a bean definition to an…|
View original post 33 more words
I am learning Java Spring Framework out of personal interest. I am trying to understand how it works. Today I was learning dependency injection in Spring. I started with injecting java collections through xml beans. As you already know, if you want to set a property of primitive type, you need to put exactly the same property name in bean xml definition. I started with that for injecting a List collection named addressList.
If you want to use a custom Class (may be your own vendor or library) inside a view template, you just use it like any other places using the namespace. Like one of my templates has this in the top:
In this article you will find all the undocumented concepts of Laravel Validation Rules.
To automate composer updates and laravel artisan commands whenever you upload updated codes to AWS elastic beanstalk, you need to configure some commands. The locations are relative to your laravel’s root folder, not server root.
A good one for laravel on beanstalk. If you are experiencing composer and artisan config.
I’m working on a new project that is running an API using Laravel 5. We’re also hosting it on Amazon’s Elastic Beanstalk service, which gives us great scaling capabilities on the fly. However, since new instances of your application can be added/removed on the fly, setting your configuration requires a little more tweaking than the base install provides.
View original post 739 more words
Laravel has added support for middleware parameter since version 5.1 . So it is nice that we can pass middleware parameter from Routes.php or from controller. Let’s see an example.
or in controller constructor
and in middleware handle function you can catch argument which is passed as mentioned below:
View original post 116 more words