Laravel Developers in Sri Lanka?
Laravel is well known for fast & perfect web application development these days. Since 2016, we work with Laravel, VueJs, Angular, and Bootstrap for making the
web applications for our clients.
Laravel is a Fullstack framework meaning with Laravel you can completely write applications for the web without other technologies.
Laravel vs pure PHP?
Many developers have this question. From my experience is a bad idea to develop an application from core PHP instead of using some framework. It does not mean that
PHP is bad for development. but it always depends on so many things.
- Duration for complete the projects.
- Code clean & readability
- Database migrations (possibility to alter tables and make modifications)
- Dummy Data seeding (even if it is dummy, a bit real data)
- Front-end asset compile
- Easy integration with S3 storage
- Easy packages integration
- Especially convenient developer community
there are main features you will lose when you start with pure PHP development.
What is Livewire?
Whoever works with Laravel defiantly knows this awesome package. Which helps us to develop a more flexible and reusable Laravel code.
We have even made some applications with Livewire, let us say Like single page application.
Livewire is exactly following the same code principles of Laravel. So it is really so easy to work with.
How to start with Livewire?
If you already have some existing Laravel projects. Just add the following code.
STEP 01
This compose code will add the livewire package to your project.
composer require livewire/livewire
STEP 02
add this line above header and above body tag in order to start working with Livewire.
...
@livewireStyles
STEP 03
Run this command to make a livewire component.
php artisan make:livewire favorite-button
STEP 04
The command above will create two files,
- PHP component file
- a blade file for the component
namespace App\Http\Livewire;
use Livewire\Component;
class FavoriteButton extends Component
{
public function render()
{
return view('livewire.favorite-button');
}
}
...
STEP 05
Once it is all done, you are ready to use the component you just made in all the places you want to. To do this add the code below in your content area of the application.
0 Comments