Posts

Getting started with Laravel | Laravel Part - I

Image
WHAT IS LARAVEL ? Laravel is a PHP framework. It is an MVC framework that is designed to ease your backend efforts and to minimize the keystrokes and maximize the output. With Laravel, you don't have to write several lines of codes just to achieve a simple task as you do in Vanilla PHP. For example, in PHP if one wants to fetch all the results from the database, they have to write code similar to one below  notice the number of keystrokes and a mess it would be to query multiple databases in multiple lines. Thankfully, Laravel got us covered. In Laravel the same thing can be done in a much simpler way as below  With just that, we fetch all the content of our "Table". The table keywork in the above snippet is the Model reference.  You can read more about Models here GETTING STARTED WITH LARAVEL Setting up Laravel is pretty simple, but for that, you need to have Composer installed on your computer.  After installing composer, you need to make sure that you have a local ser

What is a Laravel Model ?

Image
LARAVEL MODELS Just like any other programming language, models in Laravel helps to establish a data communication with the storage of the application (Local or Database). A Model is used to query a Database and then return the results to a controller. The above image shows a Laravel model that can be easily created using ARTISAN from the command line. You should have laravel installed before trying to use artisan. From the command line, navigate into the project folder and then you can use artisan for makiing a model. For example php artisan make:model Test and that will create a model named Test which can be found insdie the App/ folder of your project. After creating the model "Test" it can communicate to a table called "tests" (plural of the model name).  HOW TO MAKE TABLES Generating a table is fairly simple in Laravel but for that, you need to setup your database first. If you are using phpmyadmin, then you need to first create a database and then set it up

What is MVC Architecture ?

Image
WHAT IS MVC ARCHITECHTURE ? MVC stands for MODEL - VIEW - CONTROLLER and it is an architecture that seperates different logics of an application. The 3 different logics namely the Model, the View and the Controller have different roles in an application which will be discussed below In short, a View is something a user sees when they log on to the website. View gets generated when a Controller communicates with a Model and sends data recieved .  When a user opens browser and types a website address into the search bar and hits ENTER, the request gets sent to the CONTROLLER gathers the required data needed for the route using the MODEL and then throws the data to the VIEW which then gets displayed to the users. The MCV architecture can be used with many different programming languages like ASP.net , JavaScript and PHP. But here specifically, we will discuss things based on PHP and to be more precise, Laravel, A PHP framework. If you want to learn about some other programming language, d

Few things you need to know about Laravel Livewire

Image
WHAT IS LARAVEL LIVEWIRE? Laravel Livewire is a framework built for Laravel to handle and build dynamic user interface. Livewire resembles to Frameworks like Vue and React a lot but the unique thing in Livewire is, that it is setup for Laravel and that means, you can use Laravel Livewire at the comfort of using Laravel. Laravel supports Vue and React as interface handlers but addition of Livewire will prove a lot beneficial as both Vue and React integrations in Laravel quickly gets hard to manage and maintain.  HOW CAN I SETUP LIVEWIRE IN MY PROJECT ? Not that hard. Navigate inside your Laravel Project using the command line with cd folder/Laravel_Project_name and then you need to bring in the livewire package using composer. For that, inside your command line, type composer require livewire/livewire   Once that is done, you are ready to use Livewire inside your Laravel Project.  For using the Livewire CSS and JS in your application, we need to include the Livewire components, navigat

What is Vue.js and how to get Started with it

Image
WHAT IS VUE.JS ? Have you ever came across the techonology named Vue and wondered what exactly it is?   Vue js is an open source JavaScript framework for building the front end of your website. With the help of Vue, you can create modern looking Single Page Applications (SPA). A SPA have less loading time as compared to a normal website because the pages and components gets loaded all together at the start and that means, a user can navigate through the whole website without reloading the page and that saves quiet a lot of time and enhances the user experience aswell.  Vue.js was developed by Evan You and it is written in JavaScript. It have a Model-View View-Model architecture. The MVVM architecture seperates the User interface with the back end functionalities of the website.  The routing in Vue applications are done using the Vue Router libraries which we will discuss in later articles.  Vue.js have a state management system which can be used for passing data along the components fr