What is Cookies and Why it is Used?

What is Cookies?

Cookies are little text files that websites save on the user’s device (such as a computer or mobile device) when the user visits the website. These files include information that the website may download and utilize the next time the visitor visits the site.

HTTP cookies are required for modern Internet use, yet they compromise your privacy. HTTP cookies, which are a required aspect of online browsing, assist web developers in providing you with more personalized, easy website visits. Websites may remember you, your website logins, shopping carts, and other information via cookies. They may, however, be a goldmine of private information for crooks to snoop on.

Different types of cookies – Magic Cookies and HTTP Cookies

Magic cookies :- The term “magic cookies” originated in the early days of computers and describes data packets that are delivered and received unchanged. This is frequently used to enter into computer databases, such a company’s internal network. The term “cookie” as we know it today predates this concept.

HTTP cookies :- HTTP cookies are a modified form of the “magic cookie” designed for web browsing. The “magic cookie” inspired web browser creator Lou Montulli in 1994. When he assisted a website for online shopping in repairing its overburdened servers, he duplicated this idea for browsers.

What Are Cookies Used For?

Websites utilize HTTP cookies to improve the user experience. Without cookies, you would have to log back in each time you left a website or, if you accidently closed the browser, rebuild your shopping cart. making cookies a crucial component of using the internet.

Session management :- Transient cookies and per-session cookies are other names for session cookies. While a person is browsing a website, session cookies save data. Once the user ends the session, these cookies are removed.

Persistent cookie :- Cookies that are persistent are kept for a certain period of time. Until they are erased or they expire, these cookies stay on your device. Because they are used to gather user data including browsing patterns and preferences, persistent cookies are also known as tracking cookies.

First-party and third-party cookies :- Cookies that are set by websites that users visit directly are known as first-party cookies. These cookies typically store data relevant to or related with the website, such as user preferences or location.
Cookies that are associated with third-party content, such as embedded videos, advertisements, web banners, and scripts, are referred to as third-party cookies. Third-party cookies are frequently used by advertisers to monitor user behaviour.

Tracking :- Shopping sites use cookies to keep track of the items that users have previously viewed, allowing the sites to propose more things that they may be interested in and store products in their shopping carts while customers browse elsewhere.

Conclusion

Unsecured cookies may potentially provide a security risk to website owners and users. The original website or a third party receives unencrypted data about an insecure cookie over HTTP. That’s a low danger if the information is something straightforward, like if the person has already visited the site. Some websites, however, may use cookies to store user data, including personally identifying information such as login passwords and payment card details. Unencrypted transmissions of such kind of data leave them open to interception and misuse by criminals. A secure cookie only permits the transmission of cookie data via HTTPS and does not carry the same danger.

Tagged : / / / / / / / /

Laravel 5.8 crud operation “easy way”

Laravel:-Open source web application framework, written in PHP.

Step 01 : Install Laravel 5.8

composer create-project --prefer-dist laravel/laravel 002 "5.8.*"

“002” is a project name and 5.8 is a version of Laravel.

Step 02 : Update database configuration

A : .env

B : phymyadmin

NOTE:- Same name .env and database.

Step 03 : Make mode with -mcr

 php artisan make:model Today -mcr

Step 04 : Inside todays table (migrations)

Step 05 : Migrate with database

php artisan migrate

Step 06 : Make blade file in resources

Step 07 :make button in laravel dashboard (Welcome.blade.php)

 <a href="{{route('student')}}"><button type="button" btn btn-primary>Student</button></a>

Route for button inside TodayController :- Route::get(‘student’, ‘TodayController@index’)->name(‘student’);

Call blade file from index function(TodayController) :-  return view(‘day.index’);

resources->views->day->layout.blade.php

resources->views-> day->index.blade.php

#Make route for show data , back and submit.

Route::post(‘store’, ‘TodayController@store’)->name(‘store’); //store data

Route::get(‘show’, ‘TodayController@show’)->name(‘show’); // show data

Route::get(‘home’, ‘HomeController@dashboard’)->name(‘dashboard’); // back to dashboard of Laravel

Store data in data base when we hit the submit button

Step 08 : Show data (when we click on show data button)

  1. <a href=”{{route(‘show’)}}”><button type=”button” class=”btn btn-info float-right”>Show Data</button></a> // route in button
  2. Route::get(‘show’, ‘TodayController@show’)->name(‘show’); // Route (web.php)
  3. Inside show function inside TodayController
 public function show(Today $today)
    { 
        $todays =Today::all();
       return view('day.show',compact('todays'));
    }

4. Return show.blade.php With compact (all data)

5. Route in edit and delete button.

 <a href=”{{route(‘edit’,[‘id’=> $today->id])}}”><button type=”button” class=”btn btn-primary”>edit</button></a> // edit data

<a href=”{{route(‘delete’, [‘id’ => $today->id])}}”><button type=”button” class=”btn btn-danger”>Delete</button></a> // delete data

Step 09 : Edit data (edit button)

1.<a href=”{{route(‘edit’,[‘id’=> $today->id])}}”><button type=”button” class=”btn btn-primary”>edit</button></a> // edit data in edit button

2. Route::get(‘edit/{id}’, ‘TodayController@edit)->name(‘edit’); // edit route

3.TodayController->edit function

 public function edit($id)
    {
        Log::info('inside edit function');
        Log::info($id);
        $today =Today::find($id);
        return view('day.edit',compact('today'));
    }

4. return to blade file edit.blade.php

Submit button update function (TodayController)

Step 10 : Delete data

Tagged : / / / / / / /

How to Uninstall/Remove Package in Laravel?

composer remove VenderName/PackageName – The remove command removes packages from the composer.json file from the current directory.

Syntax :- composer remove VenderName/PackageName

Syntax:- composer remome VenderName/PackageName1

VenderName/PackageName2

If you want to remove more than one package then you have to run this command.

Ex:- composer remove fzaninotto/faker

–dev: It remove packages form require-dev

This means, if it is in require-dev, then you have to remove it from there, then for this, you have to flag the dev.

Ex: composer remove fzaninotto/faker –dev

Tagged : / / /

How to Install/Add-Package in Laravel?

composer require VendorName/PackageName – This command installs a package and any packages that it depends on.

syntaxexample
composer require VendorName/PackageNamecomposer require fzaninotto/faler
composer require VendorName/PackageName:tagcomposer require fzaninotto/faker:dev-master
composer require VendorName/PackageName:versioncomposer require fzaninotto/faker:1.9.0

–dev: Add packages to require-dev.

composer require VendorName/PackageName –dev

https://packagist.org/ This is the website, from where you will get Php packages. This is the package repository of Php. You have to open this site, whatever your requirement is, you can do that package.

If you want a viewer with PDF, then you search by typing PDF. Here the first one wants Dompdf / Dompdf, so I clicked on it. After clicking on it, it will show you what is the version tag. And it will also show how to install it. So to install it, you have to type the command composer require dompdf/dompdf.

Before running this command, you should check that the composor.json file which you have is empty. That is, our project is not dependent on anyone. But now we have the requirement of this project so we will run this command.

Tagged : / / / /

How to set up a new or existing package?

Manually Creating composer.json file

You have to create a composer.joson file and write JSON code yourself with the required properties.

  • composer config –global(-g) – Operate on the global config file located at $COMPOSER_HOME/comfig.json by default. Without this option, this command affects the local composer.json file.
  • composer config –list (-l) __ It shows all the current config variables.
  • composer config setting-key “setting-value” – It sets the config key to the value.
  • composer config –unset – It removes the configuration element named by setting-key.
  • composer config –editor (-e) – Opens the config file (composer.json) in an editor. Use the –global flag to edit the congif (config.json).

Keys:

  • name
  • version
  • type
  • description
  • license
  • homepage
  • keywords
Tagged : / / / /

How do you create a composer.json file by using this command in your project?

We need to create a folder in xampp server. I am going to the local server (C /Drive ) then going to xampp server. Here at htdocs. Then here we will create a project folder that will run on the server.

I will need a text editor I am using Visual studio code you can use notepad, notepad++, sublime text anything.

Then Visual Studio Code has to be opened. After that open folder cmp has to go there location me c/drive/xampp/htdocs/ after that select project folder cmp. Here my project folder has been opened.

Here we create a file index.php and write the code of the PHP in it. And if we need to start the server, then we have to go to Windows Search and search xampp. After that open it and start the Apache server.

After this, we have to run on the tube, for that we have to do a few searches in the search in Windows Manu and open the Run Administrator.

After that, we have to go to my own project of CMD.
Tagged : / /

How to Become a Laravel Developer?

In the world of web development, things are constantly changing. On the other hand, developers have to keep pace with the changing technologies, while businesses look for efficient technologies that help them engage with customers efficiently.

One technology making major waves in the web development field is Laravel. The framework is a hit among web artisans because of its accessibility, power, and other add-on tools to build robust applications. Using the agile development approach, Laravel builds the entire development process without sacrificing functionality.

What is Laravel?

Laravel is a free, open-source PHP-based Web Framework for building High-End Web Applications, following the Model View Controller architectural pattern and based on Symfony. It is created by Taylor Otwell. Laravel is a powerful MVC PHP framework designed for developers who need a simple and elegant toolkit to build full-featured web applications.

What is Laravel Developer?

Laravel Developer is a software professional specializing in the Laravel framework. Now that Laravel technology includes a wide range of tools and libraries that speed up the development cycle, a Laravel developer can focus on design, innovation, functionality, and other things that really matter.

Prerequisities of a Laravel Developer:

  • Bachelor’s Degree/MS degree in Computer Science, Engineering, MIS, or similar relevant field.
  • Proficient in PHP, Javascript, MySQL, AJAX, jQuery, CSS and HTML.
  • Demonstrated attention to detail – in-depth knowledge of object-oriented PHP and Laravel 5 PHP Framework.
  • Experienced with SQL schema design, SOLID principles, REST API design
  • Software testing (PHPUnit, PHPSpec, Behat).
  • Excellent written and oral communication skills.
  • Working on Laravel won’t be easy so he has to be a creative thinker and a problem-solver.

Skills Required to Become an Laravel Developer:

It is fundamental to know PHP: Larvel is a PHP web framework and therefore must be well aware of PHP before placing his hand on the development process. Although it is built on the MVC pattern, its building blocks are PHP functions.

Clarity on the MVC pattern: Larvel is a PHP web framework and therefore must be well aware of PHP before placing his hand on the development process. Although it is built on the MVC pattern, its building blocks are PHP functions.

Why is Laravel the Best PHP Framework?

Because of the dire need for structured development methodologies. Laravel is a PHP framework that has become the go-to solution for developers around the world. It hosts a large ecosystem that allows for instant hosting and system deployment.

In the corporate space, Laravel web development fundamentals have been extensively used to build websites that are capable of running behind complex algorithms and handling multiple visitors at once.

Here are the some few reasons:

  • Security: One of the biggest headaches for programmers is building secure websites and apps. Laravel web development uniquely provides developers with a secure way to maintain the security of their apps.
  • MVC Support: Another major reason why Laravel is beloved among developers is that it supports MVC architectures like Symfony which helps in establishing clarity between logic and presentation. As a result, the app is able to perform better and allows for better documentation.
  • Object-Oriented Libraries: Larvel Framework provides an object-oriented library and comes with an array of pre-installed versions of which are not found in other PHP frameworks.
  • Database Migration: Data between development between the machines is a major pain point for the synchronization programmers. After long working hours and countless changes in our database, these changes can be very hard to save your database. But with Laravel, database migration is very simple, you store these changes, migration, and seeds.

What does a Laravel Developer do?

The world of software technology has given rise to a community of developers who specialize in various technologies.

A Laravel developer is like any other software developer. But, one thing that sets them apart is their special affinity for the Laravel framework using the PHP programming language. Larvel developers make it possible to create highly functional web applications that enhance the user experience.

Roles and Responsibility of Laravel Developer:

  • Building and maintaining modern web applications using standard web development tools
  • Writing clean and secure modular codes that have undergone strict testing and evaluation
  • Checking the validity and consistency of HTML, CSS, and JavaScript on different platforms
  • Debugging and resolving technical issues
  • Maintaining and designing databases
  • Performing back-end and User Interface (UI) tests to enhance the functionality of an application
  • Collaborating with other developers (front-end, back-end, mobile app, etc.) and project managers to move the Software projects faster
  • Documenting the task progress, architecture, and development process

The current PHP version is one of the most popular and desirable frameworks for companies that want to hire a Laravel developer, so if you’re well versed with the current version, your fellow developers will have your say. PHP includes over-the-top benefits and many other features that every software developer dreams of. It has libraries and modules which makes dynamic development a snap, plus saves development cost.

Features of Laravel:

The Future Scope of Laravel Developers:

Before saying anything about the future, I would like to mention here some MNCs which are using PHP today. Google, Yahoo, Rediff, Facebook, Intel, Digg, Flickr, Zynga, Borland, eBay, Nokia, Oracle, etc. I am telling you only one thing that there are a lot of small and popular online web applications based on PHP which is running online and they are all managed and addons by PHP developers. This means you have lots of opportunities to work with your dream companies.

Some of the most frequent designations include Laravel Trainee, Programmer, Web Developer, Web Designer, Software Developer. So, you see the future is bright!

To start with Laravel, check out the DevOpsSchool course. You’ll learn basic structures and techniques and dive into advanced Laravel concepts such as Views & Blade Templating Engine, Working with Routes, Handling Requests & Responses, Using Controllers and Models. You’ll even also join our Online and Classroom Programs.

Tagged : / / /

What is composer.JSON? How do I use it?

A file is generated from the composer tool. Which is the main file of the whole project which we call the composer file. The extension file is composer.json. It is the main composer.json that defines your project requirements.

How to setup a new or existing package

You can also say how to create a composer.json file in a Project to make it a package.

  • Ussing composer init Command
  • Manually Creating composer.json file

Ussing composer init Command

composer init – It is used to set up a new or existing package. The init command creates a basic composer.json file in the current directory.
Every project is a package.
As soon as you a composer.json in a directory, that directory is a package.

composer.json

Package name – in order to make that package installable you need to give it a name. It consists of vendor name and project name, separated by/. The name can contain any character, including white spaces, names are case insensitive, the convention is all lowercase and dashes for word separation. It is required for published packages(libraries).

Syntax:- vendorname/packagename

Ex:- devopsschool/dev

Description- A short description of the package. Usually, this is one line long. It is required for published packages(libraries).

Authors – The authors of the package. This is an array of objects.

Each author object can have the following properties:

  • name: The author’s name. Usually their real name.
  • email: The author’s email aaddress.
  • homepage: An URL to the author’s website.
  • role: The author’s role in the prject (e.g. developer or translator)

Minimum Stability – Composer accepts these flags as minimum-stability settings. The defualt setting for minimun-stability if not provided is assumed to be stable, but you sould define any of the flags down the hierarchy.

  • stable (most stable)
  • re
  • beta
  • alpha
  • dev (least stable)

Package Type – Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. It default to library.

  • Library
  • Project
  • Metaapackage
  • Composer-plugin

License – The license of the package. This can be either a string or an array of strings.

Ex:- MIT

Tagged : / / / /

Introduction to Laravel

What is Laravel?

Laravel is a web framework built on PHP. That is, the code that has been done has been coded in PHP. You can use it to create High-End Web Applications, you can create the very best web application using Laravel in it. Laravel follows the architectural pattern of MVC (Model View Controller). Laravel was created by Taylor Otwell.

Advantages of Laravel?

  • Open Source
  • Collection of tools
  • Save Time
  • Improve Productiity
  • Robust and Easy
  • Security of the Application
  • Authentication
  • Routing
  • Templating

Requirements for Learning Laravel

Do You Know

  • HTML
  • CSS
  • JavaScript
  • SQL
  • PHP OOP
  • MVC
  • Composer

Laravel Requirements

  • PHP 7.2.0 or Higher
  • XAMPP (Apache + MariaDB + PHP + Perl)
  • WAMP/LAMP/MAMP
  • Composer
  • Text/Code Editor- Notepad++, VS Code, ATOM, Brackets
  • Web Browser- Google Chrome, Mozilla Firefox, Edge
Tagged : / / / / /

How to Install Composer in Laravel?

Composer requires PHP 8.0+ to run

  • Download Composer exe from official website then install it
  • Use command line installation

-May need to set Path or use php composer.phar init

Go to the windows search menu and type cmd

Open Command Prompt then right click and go to Run as administrator

Then show you screen c:\Windows\system32>
and then type composer -V and press enter bottom.
If your composer is already installed then your computer screen will show the composer version. And if not already installed it will show – Composer is not recognized unknown internal and external commands, compatible programs, and batch files.

How to Update Composer

There is some new update in composer, so if you want to update it then you have to run command for it:

composer self-update

How to Roll Back Composer Update

If that update starts happening, then you can roll back that update and go back to the old versions. For which you have to run the command:

composer self-update –rollback

Tagged : / / / /