0% found this document useful (0 votes)
18 views

Unit 5 laravel (1)

Unit 5 covers the deployment of Laravel applications, focusing on essential PHP extensions such as BCMath, Ctype, cURL, JSON, MbString, OpenSSL, PCRE, and PDO. It aims to provide students with definitions, concepts of Laravel deployment, and configuration management. The unit includes practical examples and instructions for enabling and using these extensions in PHP applications.

Uploaded by

vishalroy25740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Unit 5 laravel (1)

Unit 5 covers the deployment of Laravel applications, focusing on essential PHP extensions such as BCMath, Ctype, cURL, JSON, MbString, OpenSSL, PCRE, and PDO. It aims to provide students with definitions, concepts of Laravel deployment, and configuration management. The unit includes practical examples and instructions for enabling and using these extensions in PHP applications.

Uploaded by

vishalroy25740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Unit 5

Deployment of Laravel Application to the Production


Unit Content

PHP Extensions:
1. BC Math
2. Ctype
3. cURL
4. JSON
5. MbString
6. OpenSSL
7. PCRE
8. PDO Server Configuration
9. Nginx
10. Optimizing Route Loading
11. Optimizing View Loading
12. Deployment with vapor

Rajat Kumar Laravel with Vue.js


5/6/2024 2
Unit 5
Unit Objective

In Unit , the students will be able to find


• Definitions of terms and concepts.
• The idea of Laravel deployment.
• Various PHP Extensions.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 3
Topic Objective

Topic : PHP Extensions

• In this topic, the students will gain the idea of various PHP extensions
and deployment of Laravel with configuration management.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 4
PHP Extension: BCMath

The BCMath extension in PHP stands for "Binary Calculator Math" and is used for arbitrary precision
arithmetic. It allows PHP developers to perform mathematical operations on numbers with very high
precision, which is especially useful when dealing with financial calculations or other scenarios where
precision matters.

BCMath provides functions for arithmetic operations like addition, subtraction, multiplication, and division,
as well as functions for more complex operations like exponentiation and square roots. Unlike standard
arithmetic operators in PHP, BCMath functions operate on strings representing numbers, allowing for
arbitrary precision calculations.

<?php
$num1 = '12345678901234567890.1234567890';
$num2 = '98765432109876543210.0987654321';

$result = bcadd($num1, $num2); // Add two numbers


echo $result; // Output: 111111111011111111100.2222222211
?>
Rajat Kumar Laravel with Vue.js Unit 5
5/6/2024 5
BCMath

To use BCMath in PHP, you need to make sure it's enabled in your PHP configuration. This typically involves
uncommenting or adding the line extension=bcmath.so (for Linux) or extension=php_bcmath.dll (for
Windows) in your php.ini file and then restarting your web server or PHP service.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 6
Ctype

The ctype PHP extension provides functions for testing the character types of
strings. These functions are useful for tasks such as data validation, input
sanitization, and character manipulation. The extension contains functions for
checking whether a character or a string contains certain types of characters,
such as alphabetic characters, digits, whitespace, punctuation, etc.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 7
Ctype
Here are some common functions provided by the ctype extension:

ctype_alnum: Checks if all characters in a string are alphanumeric.


ctype_alpha: Checks if all characters in a string are alphabetic.
ctype_cntrl: Checks if all characters in a string are control characters.
ctype_digit: Checks if all characters in a string are decimal digits.
ctype_graph: Checks if all characters in a string are printable, excluding
whitespace.
ctype_lower: Checks if all characters in a string are lowercase letters.
ctype_print: Checks if all characters in a string are printable.
ctype_punct: Checks if all characters in a string are punctuation characters.
ctype_space: Checks if all characters in a string are whitespace characters.
ctype_upper: Checks if all characters in a string are uppercase letters.
ctype_xdigit: Checks if all characters in a string are hexadecimal digits.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 8
Ctype

<?php
$string = "Hello123";

if (ctype_alnum($string)) {
echo "The string contains only alphanumeric characters.";
}

if (ctype_upper($string)) {
echo "The string contains only uppercase letters.";
} elseif (ctype_lower($string)) {
echo "The string contains only lowercase letters.";
} else {
echo "The string contains both uppercase and lowercase letters.";
}
?>

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 9
Ctype

To use the ctype extension in PHP, it's usually enabled by default as part of the
core PHP installation. However, if you need to explicitly enable it, you can do
so by ensuring that extension=ctype.so (for Linux) or extension=php_ctype.dll
(for Windows) is uncommented in your php.ini file and then restarting your
web server or PHP service

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 10
cURL

The cURL PHP extension provides an interface to the cURL library, allowing PHP developers to make HTTP
requests and interact with other network protocols like FTP, SMTP, and more. cURL stands for "Client URL
Library", and it's widely used for sending and receiving data over various network protocols.

Here are some common tasks you can perform using the cURL extension in PHP:

Sending HTTP requests: You can send GET, POST, PUT, DELETE, and other types of HTTP requests to
interact with
web servers and APIs.
Handling response data: You can retrieve response headers, response bodies, and other information returned by
the server.
Handling cookies: cURL allows you to send and receive cookies, making it possible to maintain sessions across
multiple HTTP requests.
Handling authentication: You can perform basic authentication, digest authentication, and other types of
authentication supported by cURL.
Uploading files: You can upload files to a server using HTTP POST requests with cURL.
Downloading files: You can download files from remote servers using HTTP GET requests with cURL.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 11
cURL Functions

• curl_close — Close a cURL session


• curl_copy_handle — Copy a cURL handle along with all of its preferences
• curl_errno — Return the last error number
• curl_error — Return a string containing the last error for the current session
• curl_escape — URL encodes the given string
• curl_exec — Perform a cURL session
• curl_getinfo — Get information regarding a specific transfer
• curl_init — Initialize a cURL session
• curl_multi_add_handle — Add a normal cURL handle to a cURL multi handle
• curl_multi_close — Close a set of cURL handles
• curl_multi_errno — Return the last multi curl error number
• curl_multi_exec — Run the sub-connections of the current cURL handle

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 12
cURL Functions

•curl_multi_getcontent — Return the content of a


cURL handle if
CURLOPT_RETURNTRANSFER is set
•curl_multi_info_read — Get information about
the current transfers
•curl_multi_init — Returns a new cURL multi
handle
•curl_multi_remove_handle — Remove a multi handle
from a set of cURL handles
•curl_multi_select — Wait for activity on any
curl_multi connection
•curl_multi_setopt — Set an option for the cURL multi
handle
•curl_multi_strerror — Return string describing error
5/6/2024 •code
curl_share_close — CloRasjaet Kuamacr URL Unit 5
13
cURL Functions

•curl_share_errno — Return the last share


curl error number
•curl_share_init — Initialize a cURL share
handle
•curl_share_setopt — Set an option for a
cURL share handle
•curl_share_strerror — Return string
describing the given error code
•curl_strerror — Return string describing the
given error code
•curl_unescape — Decodes the given URL
encoded string
•curl_upkeep — Performs
Rajat Kumar
any connection
Laravel with Vue.js Unit 5
5/6/2024 14
upkeep checks
JSON

The JSON PHP extension provides functions to work with JSON data within
PHP. JSON (JavaScript Object Notation) is a lightweight data interchange
format widely used for data exchange between a server and a web client, as
well as for storing configuration data and transmitting structured data
between different systems.

The JSON extension in PHP provides functions for encoding PHP data
structures into JSON format and decoding JSON-encoded data back into PHP
data types. This facilitates communication between PHP scripts and other
systems or services that use JSON for data exchange.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 15
JSON PHP

Here are some common functions provided by the JSON extension:

json_encode: Encodes a PHP value into a JSON string.


json_decode: Decodes a JSON string into a PHP value (object, array,
string, etc.).
json_last_error: Returns the last error occurred during JSON encoding
or decoding.
json_last_error_msg: Returns a string description of the last error
occurred during JSON encoding or decoding.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 16
Mbstring

The mbstring extension in PHP stands for "multibyte string" and is used
for handling multibyte encodings such as UTF-8, which is crucial for
supporting a wide range of languages and characters beyond the ASCII
character set. This extension provides functions to manipulate multibyte
strings in PHP, including functions for string encoding, decoding, splitting,
and case conversion.

If you're working with multilingual text or text containing characters


beyond the ASCII range, it's important to have the mbstring extension
enabled in your PHP configuration. You can typically enable it by
uncommenting or adding the following line in your php.ini configuration
file:

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 17
Mbstring

While there are many languages in which every necessary


character can be
represented by a one-to-one mapping to an 8-bit value,

there are also several languages which require so many


characters for written communication that they cannot be
contained within the range a mere byte can code (A byte is
made up of eight bits.

Each bit can contain only two distinct values, one or zero.
Because of this, a byte can only represent 256 unique values
(two to the power of eight)).

5/6/2024 Multibyte character Rajat


encoding
Kumar
schemes
Laravel with Vue.js
were developed
Unit 5
to 18
Mbstring

When you manipulate (trim, split, slice, etc.) strings encoded in a multibyte
encoding,
you need to use special functions since two or more consecutive bytes may
represent a single character in such encoding schemes. Otherwise, if you apply a
non-multibyte-aware string function to the string, it probably fails to detect the
beginning or ending of the multibyte character and ends up with a corrupted
garbage string that most likely loses its original meaning.

mbstring provides multibyte specific string functions that


help you deal with multibyte encodings in PHP. In addition to that,
mbstring handles character encoding conversion between the
possible encoding pairs. mbstring is designed to handle Unicode-
based encodings such as
UTF-8 and UCS-2 and many single-byte encodings for convenience

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 19
OpenSSL

The OpenSSL PHP extension provides an interface to the OpenSSL library,


allowing PHP developers to perform various cryptographic operations such
as encryption, decryption, digital signature generation and verification,
secure connections over HTTPS, and more.

This extension is essential for applications that require secure


communication over networks, handling encrypted data, implementing
secure authentication mechanisms, and ensuring data integrity.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 20
OpenSSL
Configuration

To enable the OpenSSL extension in PHP, you typically need to:

Ensure that the OpenSSL library is installed on your system. This library is usually installed by default
on most Unix-like systems (e.g., Linux, macOS), but you might need to install it manually on some
platforms.
Enable the OpenSSL extension in your PHP configuration. You can typically do this by uncommenting
or adding the following line in your php.ini configuration file:

After making changes to the php.ini file, you may need to restart your web server for the changes to
take effect.
Once the OpenSSL extension is enabled, you can use PHP's built-in functions provided by the
extension to perform various cryptographic operations. For example, you can use functions like
openssl_encrypt() and openssl_decrypt() for symmetric encryption, openssl_sign() and
openssl_verify() for digital signatures, and openssl_pkey_new() for generating cryptographic key pairs.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 21
OpenSSL Functions

Sr.No Function & Description Version


1 openssl_pkey_new()Returns a resource 5.0.0
identifier that has new private and public key pair

2 openssl_pkey_get_private()Returns the private key 5.0.0


3 openssl_pkey_get_public()Returns the public key 5.0.0
4 openssl_pkey_export_to_file()Exports the key to 5.0.0
a file
5 openssl_private_encrypt()Encrypts the data with the 5.0.0
private key
6 openssl_public_encrypt()Encrypts the data with 5.0.0
public key
7 openssl_public_decrypt()Decrypts the data with the 5.0.0
public key
8 openssl_private_decrypt()Decrypts the data with the 5.0.0
private key
Rajat Kumar Laravel with Vue.js Unit 5
5/6/2024 22
PCRE [Regular Expressions (Perl-Compatible)]

The PCRE (Perl Compatible Regular Expressions) PHP extension provides a powerful
set of functions for working with regular expressions in PHP. Regular expressions are
patterns used to match character combinations in strings, allowing for advanced
text processing and manipulation.

PCRE is particularly useful when you need to perform tasks such as:

Searching for patterns within strings.


Replacing substrings based on patterns.
Validating input data against specific patterns or formats.
Extracting data from strings based on patterns.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 23
Cont…

If you encounter any issues related to PCRE functions not being available, it
may indicate a problem with your PHP installation, and you may need to
recompile PHP with PCRE support or install the PCRE library on your system.

Once the PCRE extension is enabled, you can use PHP's PCRE functions like
preg_match(), preg_replace(), preg_split(), and others to perform a wide range
of text processing tasks using regular expressions.

Regular expressions are a powerful tool for string manipulation, but they can
also be complex and tricky to get right. It's essential to understand regular
expression syntax and best practices to effectively use PCRE functions in PHP.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 24
PDO Server Configuration

Configuring PDO (PHP Data Objects) for server-side usage involves setting up both
the PDO extension in PHP and configuring the database server.

PHP PDO Extension Configuration:


Ensure PDO Extension is Enabled: Make sure that the PDO extension is enabled in
your PHP installation. You can check this by creating a PHP file with phpinfo()
function and accessing it through a web browser. Look for the PDO section to
confirm if it's enabled.
Database Driver: Decide which database driver you'll be using with PDO (e.g.,
MySQL, PostgreSQL, SQLite). Ensure that the corresponding PDO driver is installed
and enabled in your PHP configuration. For example, if you're using MySQL, you
need the pdo_mysql extension enabled.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 25
PDO Server Configuration

Connection Parameters: Set up the connection parameters for your database. These typically
include the database hostname or IP address, port number, database name, username, and
password.
PDO DSN (Data Source Name): Construct a PDO DSN string that specifies the database driver, host,
port, and database name. For example, for MySQL, the DSN might look like
mysql:host=localhost;port=3306;dbname=mydatabase.
Database Server Configuration:
Database Setup: Ensure that the database server is installed and running. If not, install and
configure the database server software (e.g., MySQL, PostgreSQL).
Database User: Create a database user with appropriate privileges to access the database. It's a
security best practice to grant only the necessary permissions required by your application.
Firewall Configuration: If your database server is running on a separate machine, ensure that the
firewall settings allow incoming connections on the database port.
Network Configuration: Configure your database server to accept connections from the PHP server.
This might involve configuring network settings, such as binding the database server to a specific IP
address or allowing remote connections.

Rajat Kumar Laravel with Vue.js


5/6/2024 26
Unit 5
Nginx

In Laravel deployment, Nginx serves as the web server that handles incoming HTTP requests and
routes them to your Laravel application for processing. Nginx is responsible for efficiently serving
static files, managing client connections, and directing PHP requests to the PHP interpreter for
dynamic content generation.

Receiving Requests: When a user accesses your Laravel application through a web browser or an API client,
their request is sent to the Nginx server.
Routing Requests: Nginx examines the request URL and determines how to handle it based on the server
configuration. For Laravel applications, Nginx typically routes requests to the Laravel application's entry point,
which is usually the index.php file in the public directory.
Serving Static Files: Nginx efficiently serves static files such as images, CSS, JavaScript, and other assets
directly to clients without involving the PHP interpreter. This helps improve performance and reduce server
load.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 27
Nginx

Processing PHP Requests: When Nginx encounters a request for a PHP file, it passes the request to
the PHP FastCGI Process Manager (FPM). PHP-FPM is responsible for executing PHP code and
generating dynamic content.

Interacting with Laravel: Once PHP-FPM receives a PHP request, it loads the Laravel framework and
routes the request to the appropriate controller or route defined in your Laravel application. Laravel
processes the request, interacts with the database, and generates the response.

Returning Responses: After processing the request, Laravel sends the response back to PHP-FPM,
which passes it back to Nginx. Nginx then sends the response to the client that made the initial
request.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 28
Autoloader Optimization

Autoloader optimization in Laravel deployment refers to the process of optimizing the autoloading
mechanism provided by Composer, which is the PHP dependency manager used by Laravel.

In Laravel applications, Composer manages the autoload process by generating an optimized


autoloader file based on the class mappings defined in the composer.json file and the vendor
directory where Composer installs dependencies.

Autoloader optimization is essential for improving the performance of your Laravel application,
especially in production environments where response time and server resources are critical. By
optimizing the autoloader, you can reduce the time it takes for PHP to locate and load classes, leading
to faster response times and improved overall performance.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 29
Autoloader Optimization

Here's how autoloader optimization works in Laravel deployment:

Composer Autoload Optimization: Laravel provides an Artisan command named optimize that you
can run to optimize the Composer autoloader. This command performs several tasks, including
classmap generation and optimizing the Composer autoloader configuration.

php artisan optimize

This command generates a bootstrap/cache/compiled.php file that contains a class map of all the
classes used in your application. This class map helps PHP locate classes more efficiently, reducing the
overhead of autoloading individual files.
Classmap Generation: The optimize command generates a class map that maps each class name to
its corresponding file path. This class map is then used by PHP's autoloader to quickly locate and load
classes when they are referenced in your application.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 30
Cont…

Caching Autoload Files: Additionally, Laravel caches the optimized autoloader files in
the bootstrap/cache directory. This cached autoloader file is loaded automatically
when your application starts, eliminating the need for Composer to parse and
process the composer.json file and autoload files on every request.
Improved Performance: By optimizing the autoloader, Laravel reduces the number
of file system operations required to load classes, resulting in faster application
startup times and improved response times for incoming requests.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 31
Optimizing Route Loading

To optimize or improve the speed of your application you will also need to
optimize your route loading. This is very important, especially for
applications with many routes.

Optimizing route loading in Laravel deployment refers to the process of improving the performance
and efficiency of how Laravel loads and processes routes within your application. Routes in Laravel
define the entry points for incoming HTTP requests and map them to specific controller actions or
closures.

Route caching
To optimize route loading, you will need to run the following command
while deploying your application to the live server:

php artisan route:cache

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 32
Cont…

This above command makes all your hundreds of routes into a single method
in a cached file, and thereby boosts the registration performance of hundreds
of routes.

Note: You must convert closure routes to controller classes if you want to

use route caching. If you want to clear the route cache, you can run the

following command:
php artisan route:clear

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 33
Optimizing View Loading

When it comes to the deployment of a Laravel application to a live server, there


are a few things you need to do. One of these is optimizing how the view will
load.

Command

When sending your application to a live server, you need to ensure you run the view:cache
artisan command amid your deployment process:
php artisan view:cache

This command precompiles all your Blade views so they are not compiled on
demand, which improves the performance of each request that returns a view. It
also clears the previous view cache to recompile new views. In other words, this
quick and simple process will enhance the performance of your application.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 34
Debug Mode

In Laravel deployment, Debug Mode refers to the configuration setting that


controls whether detailed error messages and stack traces are displayed to
the user when an error occurs.

Debug Mode is typically enabled during development to aid in identifying


and fixing issues quickly. However, it should be disabled in production
environments for security and performance reasons.

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 35
Cont…

Enable Debug

Laravel provides APP_DEBUG flag in .env file to handle application debug


mode, default it true and
when you change to false it means you are disabling debug mode.

Search APP_DEBUG key in .env file and change true to enable debug mode
and false for disable debug mode.

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true APP
_URL=http://localhost

LOG_CHANNEL=single

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 36
Cont…

Disable Debug

Set the APP_DEBUG environment variable value to false in the .env


environment configuration file.

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=false APP
_URL=http://localhost

LOG_CHANNEL=single

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 37
Cont…

Enable or disable debug mode using app.php

Open the app.php file located in your config/app.php laravel project. Search for
debug key and change true to enable debug mode and false for disabling debug
mode default it will show false.

'debug' => env('APP_DEBUG', false),

Enable
Debug
'debug' => env('APP_DEBUG', true),

Disable Debug

'debug' => env('APP_DEBUG', false),

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 38
Deploying to Laravel Vapor

Laravel Vapor has its own CLI command that will let you deploy your various Vapor
environments.

Chipper CI does not install the vapor command globally.

We assume instead that most projects include Vapor as a composer dependency.

For most projects, this means that you can simply use the vapor command as it's likely present
at ./vendor/bin/vapor (remember, ./vendor/bin is set in $PATH).

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 39
Cont…

Deploying from Vapor in Chipper CI has two steps:

Set a VAPOR_API_TOKEN environment variable in the project settings


This can be generated within the Vapor API settings dashboard
Within your build pipeline, run one of the following commands

# Most simply, deploy your "production" environment


vapor deploy production

# Optionally, add some related data to the deployment


vapor deploy production --commit="${CI_COMMIT_SHA}" --
message="${CI_COMMIT_MESSAGE}"

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 40
Cont…

Deploying Environments

If you would like to deploy to different Vapor environments depending on the


branch, tag, or even commit message you can use some custom logic within
your pipeline.
For example, here's a way to deploy to production versus staging:

# Deploy to a different environment depending on the branch

if [[ $CI_COMMIT_BRANCH == 'master' ]]; then


vapor deploy production
fi

if [[ $CI_COMMIT_BRANCH == 'develop' ]]; then


vapor deploy staging
fi

Rajat Kumar Laravel with Vue.js Unit 5


5/6/2024 41
Laravel forge

Laravel Forge is a service provided by Laravel that simplifies the process of deploying and managing
Laravel applications on cloud servers. It is designed to make server provisioning, deployment, and
maintenance easier for developers, particularly those who are not specialized in server administration.

Key features and functionalities of Laravel Forge include:


Server Provisioning: Forge allows you to provision servers on popular cloud platforms such as
DigitalOcean, AWS, Linode, and others. You can select your preferred server size, location, and operating
system directly from the Forge dashboard.
Deployment: Forge supports automated deployment of Laravel applications from popular version control
systems like Git repositories (GitHub, GitLab, Bitbucket). Once a server is provisioned, Forge can
automatically pull your code and set up the necessary environment for your Laravel application.

Rajat Kumar Laravel with Vue.js


5/6/2024 42
Unit 5
Laravel forge

SSL Certificate Management: Forge simplifies the process of securing your application with SSL certificates. It
can automatically obtain and configure Let's Encrypt SSL certificates for your domain names.
Database Management: Forge integrates with popular database services like MySQL, PostgreSQL, and
MariaDB. It allows you to easily create and manage databases for your application from the Forge dashboard.
Queue Workers and Scheduler: Forge provides tools to manage queue workers (using tools like Redis or
Beanstalkd) and schedule tasks (using Laravel's task scheduler) directly from the dashboard.

Monitoring and Notifications: Forge provides basic server monitoring and alerting features. It can notify you
via email or Slack when certain events occur, such as server downtime or high resource usage.
Server Configuration: Forge handles server configuration tasks such as setting up Nginx or Apache web servers,
PHP versions, and other necessary dependencies for Laravel applications.
Collaboration and Team Access: Forge supports team collaboration by allowing multiple users to access and
manage servers. You can control user permissions and access levels.

Rajat Kumar Laravel with Vue.js


5/6/2024 43
Unit 5
Daily Quiz
Q1. Which company invented Vue.js?
1.Facebook
2.Google
3.Oracle
4.Twitter

Q 2 - Which of the following data binding interpolation is also known as


"Mustache" syntax?
1.v-on
2.v-
model
3.{{}}
4.[]

Q3-
Which
of the
followin
g 5/6/2024
is the Rajat Kumar Laravel with Vue.js
44
Unit 5
Daily Quiz

Q 4 Which of the following is the correct syntax to use for loop in Vue.js?
1.vFor
2.v-for
3.*v-for
4.None of the above.

Q 5 - Which of the following syntax is correct for creating a Vue.js


instance?
1. var text = new object ({//options})
2. var text = new class ({//options})
3. var text = new text ({//options})
4. var text = new Vue({// options })

Rajat Kumar Laravel with Vue.js


5/6/2024 45
Unit 5
Weekly Assignment

1. Elaborate the term BCMath and Ctype.


2. Explain the concept of cURL and JSON.
3. Discuss about PDO Server Configuration.
4. Elaborate Nginx and Laravel server
management.
5. Show your understanding about
Debug mode and
Deployment with Vapor

Rajat Kumar Laravel with Vue.js


5/6/2024 46
Unit 5
Old Question Paper

Rupendra kaushik laravel with vuejs Unit II


5/6/2024 47
Old Question Paper

Rupendra kaushik laravel with vuejs Unit II


5/6/2024 48
Old Question Paper

Rupendra kaushik laravel with vuejs Unit II


5/6/2024 49
Topic Link ( YouTube & NPTEL Video Links)

YouTube /other Video Links

https://www.youtube.com/watch?v=5G1zxqFPKsA

https://www.youtube.com/watch?v=qJq9ZMB2Was

https://www.youtube.com/watch?v=98LrR740GNU

5/6/2024 Rajat Kumar Laravel with Vue.js Unit 5 50


MCQ (End of Unit)

1. Which method returns the average value of a


given key ?
•average()
•avg()
•median()
•avg_val()

2. Bootstrap directory in Laravel is used to


•Initialize a Laraval application
•Call laravel library functions
•Load the configuration files
•Load laravel classes and models

3.Which artisan command is used to remove the


compiled class file.
•clear-compiled
•clear compiled
•compiled:clear
•clear:all

Rajat Kumar Laravel with Vue.js


5/6/2024 51
Unit 5
MCQ (End of Unit)

4.Which method breaks the collection into multiple, smaller


collections of a given size
• split()
•chunk()
•explode()
•break()

5.Artisan command to flush the application cache:


•cache:flush
•cache:clear
•cache:forget
•cache:remove

6.The vendor directory contains


•Laravel Framework code
•Assets
•Third-party code
•Configuration files

Rajat Kumar Laravel with Vue.js


5/6/2024 52
Unit 5
Glossary Questions

1. What type of problems did you have working with Laravel or VueJS
projects and how did you solve them?
2. What is Laravel Eloquent? Why is it nice to have for development?
3. How is the Vue Js Browser support these days?
4. What is your favorite feature of Laravel?
5. A project is using Laravel 6 and with LaravelShift could move to 7. Should
it?
6. What is your favorite feature of Laravel?
7. Database Migrations - What is so useful about them?
8. What are Laravel Service Providers used for? Give an example in one of
your projects?
9. What is your favorite feature of Laravel?
10. Axios Errors - How do you debug them? What tools do you use for it?

Rajat Kumar Laravel with Vue.js


5/6/2024 53
Unit 5
Expected Questions

1. Explain the term PHP Extension.


2. Write down in detail about BCMath and Ctype.
3. Explain the term Mbstring and OpenSSL.
4. Elaborate PCRE and PDO Server Configuration.
5. Write the need Route Loading.
6. Explain the term View loading.
7. Explain Autoloader Optimization in detail.

Rajat Kumar Laravel with Vue.js


5/6/2024 54
Unit 5
Recap of Unit

In this unit we studied about the deployment of Laravel Application for the production
purposes.

We studied about the various types of PHP extensions like BCMath, Ctype, cURL, JSON
and MBString etc.

We studied the concept of Laravel Server Management,


And optimization of view loading.

We studied how deployment with vapor takes place.

Rajat Kumar Laravel with Vue.js


5/6/2024 55
Unit 5

You might also like