I am Sarani Chakraborty from Kolkata. I have completed my post-graduation in computer application from AIMS I.H.E, Bangalore. .After completing my MCA I joined Logezy as a Junior Backend Developer on September 12th. This is my first job and I find this office is absolutely disciplined and nature-friendly.
After I joined here, we started with our knowledge sharing sessions from October. And this month, I got an opportunity at Logezy, to share my knowledge. As a Junior backend developer, I decided to present Basic Laravel Features.
From my limited knowledge, I explained some key points where the beginners of laravel development can understand the internal flow of this language.
Laravel is a free open-source PHP web framework created by Taylor Otwell, the initial release was in 2011. In computer programming, a software framework is a structure in which software providing generic functionality can be changed by additional user-written code.
Laravel continues to be the most favored and widely used PHP framework since 2015.
For the development of web applications, Laravel followed MVC(Model – View – Controller) Model.
- Model: It includes all the data and its related logic
- View: Present data to the user or handles user interaction
- Controller: An interface between Model and View components
First, when a User is sending any request through URL it goes to Route. Route identifies the actual controller from the URL and sends the request to that controller. The controller works as an intermediator between Model and View. From the model, the controller takes all the necessary functionalities and sends that through view as a response.
After cloning any new project, there are some necessary steps to be followed by the developers.
1).env file: It is used to store secure information like database connectivity.
DB_DATABASE = laravel
DB_USERNAME = root
2)Key Generate: The application key is a random, 32-character string stored in the
APP_KEY key in your
.env file. When developers start with a new Laravel project or clone a new project this step is very important to do.
The key is used for security and for encryption. Every Data you encrypt in your application is using
APP_KEY behind the scene.
*One very common misconception in the Laravel community-is that the
APP_KEY is used to hash passwords. Laravel uses the key for all encrypted cookies, including the session cookie.
- Controller name MUST start with a noun (in singular form) followed by the word “Controller”.
- Model names MUST be in singular form with its first letter in uppercase.
- Routes should be in the plural form of the resource it is trying to manipulate and SHOULD be all lower-case.
- Named Routes SHOULD use snake_case and dot notation.
- You SHOULD use snake_case as a file name of your Blade templates.
In the MVC framework, the letter ‘C’ stands for Controller. It acts as directing traffic between Views and Models. A RESTful resource controller sets up some default routes for you and even names them. A resource controller gives all default routes as a package.
You can also choose what actions are included or excluded like this:
<?php Route::resource('posts', 'PostsController', [ 'only' => ['index', 'show'] ]); Route::resource('posts', 'PostsController', [ 'except' => ['edit', 'create'] ]); ?>
I would like to thank my Logezy family to encourage me during the session to perform well.