Skip to main content
PHP Blog

PHP Blog

  • How to Store Session For Lifetime In Codeigniter? preview
    6 min read
    In CodeIgniter, you can store session data for the lifetime of the session by configuring the session settings in the config file. You can set the 'sess_expiration' parameter to 0, which means the session will expire when the browser is closed. You can also set 'sess_expire_on_close' to TRUE to make the session expire when the browser is closed.

  • How to Unlink Files With Codeigniter? preview
    5 min read
    In CodeIgniter, unlinking files is the process of removing files from the server directory. To unlink files with CodeIgniter, you can use the unlink() function provided by PHP.First, you need to specify the file path of the file you want to unlink. You can use the FCPATH constant in CodeIgniter to get the base path of your application. Then, concatenate the file path with the file name you want to unlink.Next, use the unlink() function to delete the file.

  • How to Create New Session In Laravel? preview
    7 min read
    To create a new session in Laravel, you can use the session() helper function provided by Laravel. You can simply call this function and set the session data by passing an array of key-value pairs as arguments. For example, you can store a user's name in the session by calling session(['name' => 'John Doe']).To access the session data later on, you can use the session() function again with the key of the data you want to retrieve.

  • How to Make Restful Api In Codeigniter? preview
    5 min read
    To create a RESTful API in CodeIgniter, you need to first set up your CodeIgniter project and install the necessary libraries. Then, you'll need to define your routes, controllers, and models for handling different API requests and responses.You can use CodeIgniter's built-in functionality for creating RESTful endpoints by extending the default controller and using HTTP methods such as GET, POST, PUT, DELETE, etc. to handle different types of requests.

  • How to Validate Multiple Sheets In Laravel Excel? preview
    6 min read
    To validate multiple sheets in Laravel Excel, you can use the SheetsValidation interface provided by Laravel Excel. This interface allows you to define validation rules for each sheet in your Excel file.To implement sheets validation, you can create a custom validation class that implements the SheetsValidation interface. Within this class, you can define the validation rules for each sheet by using Laravel's validation methods.

  • How to Make Pdf With Codeigniter? preview
    7 min read
    To create a PDF with Codeigniter, you can use a library called TCPDF. First, you need to download the TCPDF library and add it to your Codeigniter project. Then, you can create a new controller and load the TCPDF library in the constructor function.Next, you can create a function in the controller that will generate the PDF file. In this function, you can set the PDF title, author, and other properties.

  • How to Close A Connection Early In Laravel? preview
    5 min read
    In Laravel, you can manually close a connection early by using the disconnect method provided by the database manager. This method allows you to close the database connection before the end of the script execution, which can be useful in certain situations where the connection is no longer needed.To close a connection early in Laravel, you can call the disconnect method on the database manager instance, passing in the connection name as a parameter.

  • How to Send A Reset Password Link With Codeigniter? preview
    6 min read
    To send a reset password link with CodeIgniter, you can follow these steps:First, you need to create a form for users to enter their email address.In your controller, validate the email address provided by the user.Generate a unique token/code for the user and store it in the database along with their email address.Create a link with the token/code and send it to the user's email address.

  • How to Remove 'Public' From Laravel Url? preview
    4 min read
    To remove 'public' from the Laravel URL, you need to create a new virtual host configuration for your Laravel project. This involves pointing the DocumentRoot of the virtual host to the 'public' directory of your Laravel project. Additionally, you may need to update the .htaccess file in the 'public' directory to handle URL rewriting.After setting up the virtual host and updating the .

  • How to Remove Method Name From Url In Codeigniter? preview
    4 min read
    To remove the method name from the URL in Codeigniter, you can achieve this by using routes in the routes.php configuration file of your Codeigniter application.You can create a custom route that maps a specific URL pattern to a controller and method without explicitly including the method name in the URL. By doing so, you can hide the method name from the URL and provide a cleaner URL structure for your application.For example, you can create a route that maps the URL example.

  • How to Remove Duplicate Rows From Excel Import In Laravel? preview
    8 min read
    To remove duplicate rows from an Excel import in Laravel, you can use the distinct() method provided by Laravel's Eloquent ORM. After importing the Excel data into a collection, you can call distinct() on the collection to remove any duplicate rows based on all columns. This will give you a unique set of rows without duplicates. You can then further manipulate or save this data as needed in your Laravel application.