For fresh graduate students may seeking for employment in different personal skill set that they have. You have full of skill or less skill in Laravel you may asked by interviewer in order to get new job. Some of below examples may help you to be well prepare answer to the question.
Laravel is open source PHP framework which is free to use and released under MIT license. This framework is designed to develop web application using the MVC (Model-View-Controller) architectural pattern.
Laravel 9 is the latest version.
It is design pattern refer to Model, View and Controller that have difference roles but the role processing are related to each other.
By the name it works as middleman acts as a layer between the request and response. Middleware is a form of filtering HTTP requests. For example, we use this filter mechanism to checks whether application user is authenticated or not or matching required user role, so the application can determined redirect to login page or user home page. There two types of Laravel middleware: first is Global Middleware that will be running every HTTP request of the application and Route Middleware will activate for specific routes.
Route is the endpoint creating request specified by a URI (Uniform Resource Identifier) which acts as a pointer to call method in controller and accept HTTP verbs.
All Laravel routes are located routes directory. There are web.php and api.php.
For creating a resource route we have to input syntax in web.php as below
Route::resource('/student', StudentController::class);
This route syntax will support actions index (to display), create (to display saving form), store (to submit saving data), show (to show detail data, edit (to display edit form), update (to submit update data) and delete (to submit remove data).
Blade is template engine to render HTML page utilized by Laravel.
Traits in Laravel are mechanism group of function that is intended to reduce limitations of single inheritance. We cannot instantiate directly but we can use the functions in concrete class.
Here are the benefit list of Laravel
Laravel supports the following databases:
Migration are used to create database tables in Laravel. In migration file we can modified fields, create, update, or delete tables. We can call as version control for database, Laravel keeps track record of migrations that have been run. Normally migration file looks like
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
// Add other columns
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
The up() method is called when we run php artisan migrate
will create table in database and down() method is called when we run php artisan migrate:rollback
to undo the thing we just run migrated. In case we want to rollback all migrations, we can run php artisan migrate:reset
. In other scenario, if we want to drop all tables first and run migrate from start, we can run PHP artisan migrate:refresh
Eloquent is ORM (Object Relational Mapper) handling database records by representing data as objects. Each tables have Model which interact with database table to store or modified data.
GET and POST are http verbs which purpose to send data to the server. GET allows you to send data in header which you can see in URL bar as query string. POST allows you to send large amount data in body thus you can not see data in URL bar.
Artisan is the name of command-line tool in Laravel. It provides helpful command for your developing enviroment.
A function in Laravel is used to display content infomation of a variable in web browser which is mean Dump Die.
Session is used to store data information across the requests. It will keeps track of all the users requests that visit the application. Laravel provide many drivers like cookie, array file, Memcached, and Redis.
CSRF stand for Cross-Site Request Forgery which automatically generate to verify active user session who actually making the requests to the application. This token helps preventing malicious attacks on websites by attached to the submit form.
As the founder and passionate educator behind this platform, I’m dedicated to sharing practical knowledge in programming to help you grow. Whether you’re a beginner exploring Machine Learning, PHP, Laravel, Python, Java, or Android Development, you’ll find tutorials here that are simple, accessible, and easy to understand. My mission is to make learning enjoyable and effective for everyone. Dive in, start learning, and don’t forget to follow along for more tips and insights!. Follow him