<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gurpreet Kait</title>
    <description>The latest articles on Forem by Gurpreet Kait (@gurpreetkait).</description>
    <link>https://forem.com/gurpreetkait</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F902807%2F447065ee-f63c-41b6-bfe4-db3959558a0e.jpeg</url>
      <title>Forem: Gurpreet Kait</title>
      <link>https://forem.com/gurpreetkait</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gurpreetkait"/>
    <language>en</language>
    <item>
      <title>Building My First Side Project : Daily Expense Tracker – A Journey</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Fri, 01 Nov 2024 21:18:54 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/building-my-first-side-project-daily-expense-tracker-a-journey-hak</link>
      <guid>https://forem.com/gurpreetkait/building-my-first-side-project-daily-expense-tracker-a-journey-hak</guid>
      <description>&lt;h2&gt;
  
  
  The Beginning: A Personal Problem
&lt;/h2&gt;

&lt;p&gt;Every month-end felt like a mystery. Where did my money go? Sure, I was using spreadsheets and notes apps, but they were cumbersome and easy to forget. My friend had the same problem – we’d often discuss how we needed something simpler, something that would take seconds to record an expense.&lt;/p&gt;

&lt;p&gt;That’s when it hit me: why not build something ourselves?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Vision
&lt;/h2&gt;

&lt;p&gt;I wanted to create something that would be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lightning fast to use (under 5 seconds to add an expense)&lt;/li&gt;
&lt;li&gt;Mobile-first (because who carries a laptop to record coffee expenses?)&lt;/li&gt;
&lt;li&gt;Simple enough that we’d actually use it daily&lt;/li&gt;
&lt;li&gt;Smart enough to give insights about our spending&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;As a self-taught developer working at a tech startup, I chose technologies I was comfortable with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt; : Vue.js with Tailwind CSS for a clean, mobile-friendly interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt; : Laravel for robust API development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PWA Features&lt;/strong&gt; : Service workers for offline capability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt; : MySQL for reliable data storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quick Add&lt;/strong&gt; : Add expenses in seconds with smart categorization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Insights Dashboard&lt;/strong&gt; : Visual breakdown of where your money goes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PWA Installation&lt;/strong&gt; : Install on your phone like a native app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline Support&lt;/strong&gt; : Add expenses even without internet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-currency&lt;/strong&gt; : Support for different currencies&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenges Faced
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge #1: Making It Lightning Fast
&lt;/h3&gt;

&lt;p&gt;The biggest challenge was speed. If it took more than 5 seconds to add an expense, we knew we wouldn’t use it. The solution? A minimalist interface focused on quick input with smart defaults.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge #2: PWA Implementation
&lt;/h3&gt;

&lt;p&gt;Getting the PWA to work smoothly across different devices was tricky. Service workers, caching strategies, and offline support took several iterations to get right.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge #3: User Experience
&lt;/h3&gt;

&lt;p&gt;Making something simple is hard. I went through multiple iterations of the UI, constantly asking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can this be simpler?&lt;/li&gt;
&lt;li&gt;Can we remove this step?&lt;/li&gt;
&lt;li&gt;Is this really necessary?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real-World Testing
&lt;/h2&gt;

&lt;p&gt;The best part about building this was having immediate feedback. My friend and I used it daily, which led to quick iterations based on real usage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Found that category selection needed to be faster&lt;/li&gt;
&lt;li&gt;Added quick shortcuts for common expenses&lt;/li&gt;
&lt;li&gt;Improved the dashboard based on actual needs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Current State and Future Plans
&lt;/h2&gt;

&lt;p&gt;The app (&lt;a href="https://dailyexpensetracker.in" rel="noopener noreferrer"&gt;dailyexpensetracker.in&lt;/a&gt;) is now live and being used daily. Future plans include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-powered insights for better financial decisions&lt;/li&gt;
&lt;li&gt;Bank API integration for automatic tracking&lt;/li&gt;
&lt;li&gt;Smart receipt scanning&lt;/li&gt;
&lt;li&gt;Cloud backup for data security&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start Small&lt;/strong&gt; : Having just two users (my friend and me) was perfect for initial development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real Problems &amp;gt; Perfect Code&lt;/strong&gt; : Solving a real problem is more important than having perfect code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Feedback is Gold&lt;/strong&gt; : Daily usage by real users provides invaluable insights&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simple &amp;gt; Feature-rich&lt;/strong&gt; : People prefer simple solutions that work well over complex ones with many features&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  For New Developers
&lt;/h2&gt;

&lt;p&gt;If you’re just starting out, here’s my advice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build something you’ll actually use&lt;/li&gt;
&lt;li&gt;Start with a small, specific problem&lt;/li&gt;
&lt;li&gt;Launch early, iterate often&lt;/li&gt;
&lt;li&gt;Don’t worry about scaling until you need to&lt;/li&gt;
&lt;li&gt;Focus on speed and simplicity&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;

&lt;p&gt;The app is free to use at &lt;a href="https://dailyexpensetracker.in" rel="noopener noreferrer"&gt;dailyexpensetracker.in&lt;/a&gt;. I’m actively developing it and would love feedback from the community. Whether you’re a developer interested in the technical aspects or someone looking for a simple expense tracker, feel free to check it out.&lt;/p&gt;

&lt;p&gt;Remember, every big journey starts with a small step. This is my first step into building products that solve real problems, and I’m excited to keep improving and building more.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have feedback or suggestions? Feel free to reach out to &lt;a href="mailto:gurpreetkait.codes@gmail.com"&gt;gurpreetkait.codes@gmail.com&lt;/a&gt; or contribute to making the app better!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/building-my-first-side-project-daily-expense-tracker-a-journey/" rel="noopener noreferrer"&gt;Building My First Side Project : Daily Expense Tracker – A Journey&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>Why Use Laravel Data?</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Sat, 03 Aug 2024 21:05:21 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/why-use-laravel-data-5f8c</link>
      <guid>https://forem.com/gurpreetkait/why-use-laravel-data-5f8c</guid>
      <description>&lt;p&gt;I’ve been using Laravel Data for the last 1 month and I found that it’s a time saver if you don’t want to debug your arrays when passing into functions/methods as parameters.&lt;/p&gt;

&lt;p&gt;In this blog post, we’ll explore its key features, and why you should consider using it in your next Laravel project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Laravel Data?
&lt;/h2&gt;

&lt;p&gt;Spatie developed this package to simplify data transfer and transformation within Laravel applications. It allows you to easily manage data coming into and going out of your application, ensuring that it is properly formatted, validated, and transformed as needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkews1eiyhlwehowk8u8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkews1eiyhlwehowk8u8.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understand By Example
&lt;/h2&gt;

&lt;p&gt;As always let’s take an example to understand how Laravel Data works. So, let’s say we are going to store users from a request &lt;code&gt;Route::post('user',[UserController::class,'store'])&lt;/code&gt; now, let’s see how Laravel Data can handle this request.&lt;/p&gt;

&lt;p&gt;We will create a Data(DTO – Data Transfer Object) File (a simple PHP file which extends to the base class).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;App -&amp;gt; Data -&amp;gt; UserData.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let’s see how UserData will work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Data;

use Spatie\LaravelData\Data;
use Spatie\LaravelData\Optional;

class UserData extends Data
{
    public function __construct(
        public string $username,
        public int $mobile,
        public int|Optional $age,
        public bool|Optional $is_student,
        public bool|Optional $is_teacher,
    )
    {

    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can directly use it in our controller instead &lt;code&gt;Request&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use App\Data\UserData;
use App\Models\User;
use Illuminate\Http\Request;

class UserController extends Controller
{
    public function store(UserData $data)
    {
        User::create($data-&amp;gt;toArray());
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, now you should be worried about how you gonna pass extra rules to it? I mean, if you want to validate the max, min, email, etc. Yes, we easily can do that we just need to modify our &lt;code&gt;UserData&lt;/code&gt; Class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; public function __construct(
        #[Max(20)] // you can add these attributes
        public string $username,
        #[Digits(10)] // you can add these attributes
        public int $mobile,
        public int|Optional $age,
        public bool|Optional $is_student, // you can use Optional to avoid validation
        public bool|Optional $is_teacher, // you can use Optional to avoid validation
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you think that you want to add multiple attributes then you can explore &lt;code&gt;Required()&lt;/code&gt; and ofcourse you’ll not be satisfied by these examples. I’ll suggest to you to explore &lt;strong&gt;&lt;a href="https://spatie.be/docs/laravel-data/v4/advanced-usage/validation-attributes#content-digits" rel="noopener noreferrer"&gt;Laravel Data Validation Attributes&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;You can easily install the Laravel Data Package by using the mentioned command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require laravel-data/laravel-data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits Of Using LaravelData
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cleaner Code&lt;/strong&gt; : DTO helps us to keep code organized by using Data Transfer Objects (DTOs) to manage data, making it easier to read and maintain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easy Validation&lt;/strong&gt; : You can simplify data validation by defining validation rules directly in your DTOs, ensuring that data is correct before processing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Data Transformation&lt;/strong&gt; : DTO automatically transforms data between different formats, saving the time and reducing errors when working with APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type Safety&lt;/strong&gt; : By defining data types in DTOs, it helps catch errors early, ensuring that your data is always in the expected format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplified Serialization&lt;/strong&gt; : It makes serializing and deserializing data easy, so you can quickly convert data to and from formats like JSON, without writing extra code.&lt;/p&gt;

&lt;p&gt;Read Also : &lt;a href="https://dev.to/robinkashyap_01/how-to-create-custom-laravel-helpers-3lbp-temp-slug-9697716"&gt;Create Custom Laravel Helpers&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So, in short, this package (DTO) simplifies and enhances data management in Laravel applications.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/why-use-laravel-data/" rel="noopener noreferrer"&gt;Why Use Laravel Data?&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
    </item>
    <item>
      <title>Password Protected Zip File Creation in PHP</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Thu, 11 Apr 2024 17:13:24 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/password-protected-zip-file-creation-in-php-53gg</link>
      <guid>https://forem.com/gurpreetkait/password-protected-zip-file-creation-in-php-53gg</guid>
      <description>&lt;p&gt;Hello readers, today we will learn about a little bit different topics. We will see how we can create a password-protected zip in PHP.&lt;/p&gt;

&lt;p&gt;Since a few days back, I’ve been trying to write less theory, just to save time from both sides.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAUwAAACYCAMAAAC4aCDgAAABqlBMVEX08PE2ubPi8u%2F8lgP%2BzgDg8%2B81urM6Ojoir6o3uLT17%2FHj8vDh8%2B3k8%2FPW%2BPfk9PS57evtmyTe1Ek2sayk497%2FlQA%2Bs5onsqr%2FzQJqro3y8PPOoT4suLn47fH27%2B84s6P6uQvv8u%2BeqWQ0u67W0Tzw8uz4mAD09%2Fv77O%2BcwmTv%2B%2FkAAAA1NDc9Oj04OzovMTC0vLrD4uh1xr%2FI7e6o2t6DxsdbuLOg2ddDsqpVsKbZ9PY3q50hIyWx39zO%2B%2F2U29WEioios7HR2diOzMLc8PmOy89Jro5buIl9w3avx2OntViopl2PqnJst3zy0SjboDe4p2KFqYXHzlD7rwiizVvDo1Hoshvknx5wrH%2Fw1gvc2jS80VWVwHNkuonk1DZMrpeBrnqSqGNvpZXs0Du6qkZbsoqCwWrjnjYut8GauWerplH0lSGgq1zSpTHLrii2jiG5exm5oStJMxgwHy8TCSIiABeIXiAgIC06N0cdJhsCHhl5Th44MB8ADBkSHyWVfBtfUSAoEhFIPh45PjPcwj6rbzE2JypAIBRiwLF2fHxeYWJMTU%2BUnJt6gH4Wl6FXAAAVAUlEQVR4nO2diWPbxpXGAUoccgCKkExJkBEADIyQoGEeMmmRMAlZEuUrG0fJuknjbJqjmzrxbjbdJL3iNnW3m6SNJfl%2F7nsD3gR4SLIZUP5kySSOkfDjm3nvzQwGHPezk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I2kvAJRuaynguKYBiVhkl9bhWlXaoDL4aP6tk1tGos5Vt3scIrs7GMHcJzyRJhcpxVaRB16F7nEZV2%2FGGDB3gvVdKoKGyxxFlf93OToFhXG2wpiAkeqnZCtYpvVMI%2BG2acIBniKthuDs6BPUuYWDiw5MJ5M9oUEjIZa9npzkl4HsJZB86ygvcVz7d0XVCUynUy%2BYMFphak%2F%2FL1ihXKNcSnk463OyjJ67hYBK4IcbYGiuXhUhTXk0qoJ1xPI0WRymym4WhHfgKWuDgAkcvSHGbjgTI0qwZuCLKUM7VML1ZP10K5dMRJldOBZsUx6Zm7IZWC67E0g5vLjNxX4BsMQ7m5lTbPuprz6fJNhZU%2F62t8YVKws1jQrWvOpE9LnVCys22xJwScn1ruXSr8UOplmTKf3uk6O4nYydgVLJfritAp%2FXzJ0DRp%2BTp2I5nEZxGiCcWWSmKFXF%2BWNO381O9%2BGXouJ0g4wIDp9PinyQfAZPEq5Dw1ScnlzlFj2StBMwzwFLp1c0uWTxO%2F4ychy7fqFj7PyeC0c1fDUZAJwbWDW7du7jdOnl%2FiPJHGvmRxGQNjhHOS9wxK0TQNPC9WTaW%2Bk057Xb2ETaIZj5DVbR67g9POTh0y8ZwOUQIUeY5ynwDluORqNSWTzgKOo%2FuC24tE8kSOV1eTIb%2BL4mylKOCKNLuyX43jwpjMQROfgKk1tMNg8rgQbLy6X7E1LcQLb5y9oJ3LgHTIMbccWUaT6wyW9d2y197OboWUna2Kpel45jn1Or4SNJzbBQ2oolh2pVZ2UvLgCj691RwynZRTrlUsC04QwC6hgJcwOxJAmgaendOBiyVValtVRx5amRytNC471f3timTBgQKeobEPYdZX8DMT8mjFNZBeW7YUBaTlatUBO5XjqZTjVKvl%2FVolGrUtRWi5HDzhJchJZHAWSpKkel2Slmx885Lc9GImqkMtNlpDOQZLbwwjo3M%2F3wGJfwHpcBxnQ%2B1GeAAAAABJRU5ErkJggg%3D%3D" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/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cSnk463OyjJ67hYBK4IcbYGiuXhUhTXk0qoJ1xPI0WRymym4WhHfgKWuDgAkcvSHGbjgTI0qwZuCLKUM7VML1ZP10K5dMRJldOBZsUx6Zm7IZWC67E0g5vLjNxX4BsMQ7m5lTbPuprz6fJNhZU%2F62t8YVKws1jQrWvOpE9LnVCys22xJwScn1ruXSr8UOplmTKf3uk6O4nYydgVLJfritAp%2FXzJ0DRp%2BTp2I5nEZxGiCcWWSmKFXF%2BWNO381O9%2BGXouJ0g4wIDp9PinyQfAZPEq5Dw1ScnlzlFj2StBMwzwFLp1c0uWTxO%2F4ychy7fqFj7PyeC0c1fDUZAJwbWDW7du7jdOnl%2FiPJHGvmRxGQNjhHOS9wxK0TQNPC9WTaW%2Bk057Xb2ETaIZj5DVbR67g9POTh0y8ZwOUQIUeY5ynwDluORqNSWTzgKOo%2FuC24tE8kSOV1eTIb%2BL4mylKOCKNLuyX43jwpjMQROfgKk1tMNg8rgQbLy6X7E1LcQLb5y9oJ3LgHTIMbccWUaT6wyW9d2y197OboWUna2Kpel45jn1Or4SNJzbBQ2oolh2pVZ2UvLgCj691RwynZRTrlUsC04QwC6hgJcwOxJAmgaendOBiyVValtVRx5amRytNC471f3timTBgQKeobEPYdZX8DMT8mjFNZBeW7YUBaTlatUBO5XjqZTjVKvl%2FVolGrUtRWi5HDzhJchJZHAWSpKkel2Slmx885Lc9GImqkMtNlpDOQZLbwwjo3M%2F3wGJfwHpcBxnQ%2B1GeAAAAABJRU5ErkJggg%3D%3D" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create A PHP File
&lt;/h2&gt;

&lt;p&gt;Yes, you read it right, we just need a single PHP file to create a password-protected zip file. Let’s see how.&lt;/p&gt;

&lt;p&gt;Use the below code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

$password = 'password';
$zipFileName = 'protected';
$filesToZip = ['test.py', 'test.txt'];
shell_exec('zip -jrq -P ' . $password . ' ' . $zipFileName . '.zip ' . 'test.py');

//for multiple files use space between file name 
shell_exec('zip -jrq -P ' . $password . ' ' . $zipFileName . '.zip ' . 'test.txt test.py');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Description
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;zip&lt;/code&gt;: This is the command-line tool used to create zip archives.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-j&lt;/code&gt;: This flag tells &lt;code&gt;zip&lt;/code&gt; to store just the file, not its directory structure. It’s useful if you want to add files from different directories without retaining their original directory structure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-r&lt;/code&gt;: This flag stands for “recursive” and includes all files and directories within the specified directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-q&lt;/code&gt;: This flag stands for “quiet” and suppresses the output of the &lt;code&gt;zip&lt;/code&gt; command, making the process less verbose.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-P&lt;/code&gt;: This flag specifies the password for the zip file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$password&lt;/code&gt;: This is the variable containing the password for the zip file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$zipFileName . '.zip'&lt;/code&gt;: This is the name of the zip file you want to create. The &lt;code&gt;.zip&lt;/code&gt; extension is appended to the variable &lt;code&gt;$zipFileName&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'test.py'&lt;/code&gt;: This is the file or directory you want to add to the zip archive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, in summary, the command is creating a zip archive named &lt;code&gt;$zipFileName.zip&lt;/code&gt; (with the password specified by &lt;code&gt;$password&lt;/code&gt;) and adding the file &lt;code&gt;test.py&lt;/code&gt; to it, while ignoring the directory structure (&lt;code&gt;-j&lt;/code&gt; flag) and including all files and directories within &lt;code&gt;test.py&lt;/code&gt; (&lt;code&gt;-r&lt;/code&gt; flag).&lt;/p&gt;

&lt;p&gt;Suggested: &lt;a href="https://dev.to/robinkashyap_01/boost-your-productivity-with-essential-phpstorm-shortcuts-3e67"&gt;https://larachamp.com/boost-your-productivity-with-essential-phpstorm-shortcuts/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For Laravel: &lt;a href="https://medium.com/@arjunamrutiya/creating-password-protected-zip-files-in-laravel-a-step-by-step-guide-dd7ba3b9920a" rel="noopener noreferrer"&gt;Creating Password-Protected Zip Files In Laravel&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Implementing password protection for zip files in PHP is now simple and secure. Customize the code as needed for dynamic file lists or user authentication.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/password-protected-zip-file-creation-in-php/" rel="noopener noreferrer"&gt;Password Protected Zip File Creation in PHP&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
    </item>
    <item>
      <title>5 Must Laravel Packages For 2024</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Tue, 02 Apr 2024 19:26:22 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/5-must-laravel-packages-for-2024-3724</link>
      <guid>https://forem.com/gurpreetkait/5-must-laravel-packages-for-2024-3724</guid>
      <description>&lt;p&gt;Hey everyone, today we are going to see what are the most packages that we should have while we are developing a laravel application. Well, this isn’t just for 2024 it will be a kind of ever-green packages. If they will be maintained properly. HAHAHAHA!&lt;/p&gt;

&lt;p&gt;Well, Apart from fun. Let’s see the packages and I’ll be sharing the overview of the package and the creator’s profile as well. So, that you can follow the person on X.com so that you will be connected for upcoming updates. Also in general you should follow top creators like &lt;a href="https://spatie.be/" rel="noopener noreferrer"&gt;Spatie&lt;/a&gt; (contributors) because you’ll be up to date in the community.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel Debugbar
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/barryvdh/laravel-debugbar" rel="noopener noreferrer"&gt;Laravel Debugbar package&lt;/a&gt; is a powerful tool designed to enhance the debugging experience for Laravel developers. It provides a comprehensive overview of various aspects of your application’s performance and functionality, including queries, routes, views, and more. With its user-friendly interface, the Debugbar enables developers to identify and troubleshoot issues quickly, leading to more efficient development workflows and higher-quality code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://laravel-news.com/laravel-debugbar" rel="noopener noreferrer"&gt;Read this for more info&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bunz5rvtyc0uiack91t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bunz5rvtyc0uiack91t.png" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: Make sure you set the debugging mode to true if you want to use the debugger after installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creator:&lt;/strong&gt; &lt;a href="https://twitter.com/barryvdh" rel="noopener noreferrer"&gt;Barry vd. Heuvel&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// 
.env
APP_DEBUG=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Laravel Log Viewer
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/opcodesio/log-viewer?tab=readme-ov-file" rel="noopener noreferrer"&gt;Log Viewer&lt;/a&gt; is a package for &lt;a href="https://www.laravel.com/" rel="noopener noreferrer"&gt;Laravel&lt;/a&gt; that allows you to easily navigate, read, and download the logs. You can see all the other logs from Horizon, Apache, Nginx, Redis, Supervisor, Postgres, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creator&lt;/strong&gt; : &lt;a href="https://twitter.com/arukomp" rel="noopener noreferrer"&gt;Arunas Skirius&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhorubeu2qecnbxyd4lde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhorubeu2qecnbxyd4lde.png" width="800" height="726"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Yajra DataTables
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://yajrabox.com/docs/laravel-datatables/10.0/#installing-laravel-datatables" rel="noopener noreferrer"&gt;Yajra data tables package&lt;/a&gt; is one of my favorite packages on my list. I use this package almost in every project I do from scratch. It’s a Laravel package for handling server-side works of DataTables jQuery Plugin via AJAX option by using Eloquent ORM, Fluent Query Builder, or Collection. You gonna enjoy this package. Under the hood, you can modify the base class to enjoy more flexibility as I do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creator:&lt;/strong&gt; &lt;a href="https://twitter.com/aqangeles" rel="noopener noreferrer"&gt;X Profile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry79pvxshzosfuaxdlqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fry79pvxshzosfuaxdlqg.png" width="800" height="726"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel Media Library
&lt;/h2&gt;

&lt;p&gt;Imagine you’re working on your Laravel website, dealing with files can be a bit of a headache. But then you discover the Laravel Media Library package, and suddenly, managing files becomes super easy.&lt;/p&gt;

&lt;p&gt;Here’s the cool part: instead of just treating files like random attachments, you can actually think of them as proper Models in your code. That means they have a special place and purpose.&lt;/p&gt;

&lt;p&gt;So, what’s the benefit? Well, normally when you upload a file, it’s tied to a specific part of your website, like adding a profile picture during sign-up or attaching a document to a form. With the Media Library package, you can do all this without the hassle of managing each file in your database manually. The package takes care of that by setting up the right structure for you.&lt;/p&gt;

&lt;p&gt;In simple terms, the Laravel Media Library package makes handling files in your Laravel app way easier and organized. It’s like having a neat filing system for all your digital stuff!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creator:&lt;/strong&gt; &lt;a href="https://twitter.com/spatie_be" rel="noopener noreferrer"&gt;Spatie&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flo7gvrtvlnaar734cf1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flo7gvrtvlnaar734cf1e.png" width="800" height="726"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel Backup
&lt;/h2&gt;

&lt;p&gt;Here’s how it works: the package creates a backup of your entire application, bundling everything into a handy zip file. This zip file includes all the files from the directories you specify, alongside a database dump for good measure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frz4h5bfwjdekvtautj9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frz4h5bfwjdekvtautj9y.png" width="800" height="753"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, Laravel offers a rich ecosystem of packages that can significantly enhance your development experience and add valuable features to your applications. The top five packages highlighted—Laravel Debugbar, Laravel Log Viewer , Yajra Datatables , Laravel Media Library, and Laravel Backup—cover a wide range of functionalities.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/5-must-laravel-packages-for-2024/" rel="noopener noreferrer"&gt;5 Must Laravel Packages For 2024&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>package</category>
    </item>
    <item>
      <title>WhereAll and WhereAny In Laravel 10.47 Update</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Thu, 07 Mar 2024 19:29:01 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/whereall-and-whereany-in-laravel-1047-update-kc2</link>
      <guid>https://forem.com/gurpreetkait/whereall-and-whereany-in-laravel-1047-update-kc2</guid>
      <description>&lt;p&gt;Today I’m going to share an update of the Laravel 10.47 version in which we have two new Laravel Eloquent methods that make conditions easier to write most of the time in case of searching for something. We going to see how we can use these methods.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8m6m3k54z82r4nbhzgww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8m6m3k54z82r4nbhzgww.png" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before explaining the methods I’m gonna show you that If I use the search input box in my laravel app to search for something in DB. It can be by name, email, age, etc. I used to do something as mentioned below in the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// a simple search query 
$orders-&amp;gt;where('email', 'like', "%$search%")-&amp;gt;where('name','like',"%$search%");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But now you can enjoy this new method called &lt;strong&gt;&lt;code&gt;whereAll&lt;/code&gt;&lt;/strong&gt; instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  WhereAll Method
&lt;/h2&gt;

&lt;p&gt;This method can replace this whole line of code and can act easily in one syntax as mentioned in the below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// syntax
whereAll($columns, $operator = null, $value = null, $boolean = 'and')

//Usage
$orders-&amp;gt;whereAll(['email','name'],'like',"%$search%");

//Query
select * from "orders" where (name like "shantu" AND email like "shantu")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  WhereAny Method
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;whereAny()&lt;/code&gt; method adds &lt;code&gt;or&lt;/code&gt; instead of &lt;code&gt;and&lt;/code&gt; expression in a query.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// syntax
whereANy($columns, $operator = null, $value = null, $boolean = 'and')

//Usage
$orders-&amp;gt;whereAny(['email','name'],'like',"%$search%");

//Query
select * from "orders" where (name like "shantu" OR email like "shantu")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I’m gonna link the original commit here &lt;a href="https://github.com/laravel/framework/pull/50344" rel="noopener noreferrer"&gt;Add &lt;code&gt;whereAll&lt;/code&gt; and &lt;code&gt;whereAny&lt;/code&gt; methods to the query builder&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you find this update helpful.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/whereall-and-whereany-in-laravel-10-47-update/" rel="noopener noreferrer"&gt;WhereAll and WhereAny In Laravel 10.47 Update&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
    </item>
    <item>
      <title>Upload Files Using Filepond In Laravel</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Fri, 08 Dec 2023 19:30:08 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/upload-files-using-filepond-in-laravel-1eao</link>
      <guid>https://forem.com/gurpreetkait/upload-files-using-filepond-in-laravel-1eao</guid>
      <description>&lt;p&gt;Today we are going to learn a new and I like the Ux of the filepond library. The way it uploads the files and actions provides the functionalities like editing images as well. You can explore the library here on &lt;a href="https://pqina.nl/filepond/" rel="noopener noreferrer"&gt;filepond website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will use File Pond with Laravel here. I am working on a product where I had to upload multiple images. I chose File Pond because it provides a very convenient way to interact while uploading.&lt;/p&gt;

&lt;p&gt;I first watched the video for File Pond On the Laravel Daily YouTube channel. I’ll embed the video so you can watch also you can go to the repo where I have implemented this functionality.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;file pond library with laravel&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing File Pond And Initial Setup
&lt;/h2&gt;

&lt;p&gt;First of all, to start using File Pond we have to use the File Pond Cdn. We also can install this via npm. I’ll go with CDN for now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Installed Laravel&lt;/li&gt;
&lt;li&gt;Jquery&lt;/li&gt;
&lt;li&gt;File pond cdn (I have linked in the snippet below)&lt;/li&gt;
&lt;li&gt;Controller ( Temporary File Handler)&lt;/li&gt;
&lt;li&gt;Model ( Temporary File Handler)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have created a &lt;code&gt;welcome.blade.php&lt;/code&gt; file where I have used an input to represent file pond actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&amp;gt;
    &amp;lt;title&amp;gt;File Pond Upload&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet"&amp;gt;
&amp;lt;link href="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css" rel="stylesheet"&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;form action=""&amp;gt;
        &amp;lt;input type="file" name="filepond" id="filepond"&amp;gt;
    &amp;lt;/form&amp;gt;
    {{-- Jquery Library --}}
    &amp;lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&amp;gt;&amp;lt;/script&amp;gt;
    {{-- File Pond Js Cdn --}}
    &amp;lt;script src="https://unpkg.com/filepond/dist/filepond.js"&amp;gt;&amp;lt;/script&amp;gt;
    {{-- File Pond Jquerys Cdn --}}
    &amp;lt;script src="https://unpkg.com/jquery-filepond/filepond.jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
    {{-- File Pond Image Preview Cdn --}}
    &amp;lt;script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
    FilePond.registerPlugin(FilePondPluginImagePreview);

    $("#filepond").filepond({
        allowImagePreview: true,
        allowImageFilter: true,
        imagePreviewHeight: 100,
        allowMultiple: true,
        allowFileTypeValidation: true,
        allowRevert: true,
        acceptedFileTypes: ["image/png", "image/jpeg", "image/jpg"],
        maxFiles: 5,
        credits: false,
        server: {
            headers: {
                "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            },
            url: "/temp/upload",
            process: false,
            // revert: true,
            restore: "temp/upload/delete",
            fetch: false,
        },
    });

    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating Controller And Model
&lt;/h2&gt;

&lt;p&gt;We will create a controller &lt;code&gt;TemporaryFileController&lt;/code&gt; and Model &lt;code&gt;TemporaryFile&lt;/code&gt; to represent &lt;code&gt;temporary_files&lt;/code&gt; table. We also need a migration to create uploaded files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Migration
&lt;/h3&gt;

&lt;p&gt;You will get to know soon why we need this table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:migration create_temporary_files_table

&amp;lt;?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('temporary_files', function (Blueprint $table) {
            $table-&amp;gt;id();
            $table-&amp;gt;string('folder');
            $table-&amp;gt;string('filename');
            $table-&amp;gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('temporary_files');
    }
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In FIle Pond when we choose a file after processing it uploads directly to the server. So, in that case, this will return whatever you send in response and keep that until the form is saved in file input.&lt;/p&gt;

&lt;p&gt;You can see in the controller below the post method.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:model TemporaryFile

&amp;lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TemporaryFile extends Model
{
    use HasFactory;

    protected $fillable = ['folder','filename'];
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Controller
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:controller TemporaryFileController

&amp;lt;?php

namespace App\Http\Controllers;

use App\Models\TemporaryFile;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

class TemporaryFileController extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index(Request $request)
    {
        if ($request-&amp;gt;isMethod('delete')) {
            $filepond = $request-&amp;gt;json()-&amp;gt;all();
            $folder = $filepond['folder'];
            $tempFile = TemporaryFile::query()-&amp;gt;where('folder', $folder)-&amp;gt;first();
            $path = storage_path('app/orders/temp/' . $folder);
            if (is_dir($path) &amp;amp;&amp;amp; $tempFile) {
                DB::beginTransaction();

                try {
                    unlink($path . '/' . $tempFile-&amp;gt;filename);
                    rmdir($path);
                    $tempFile-&amp;gt;delete();
                    DB::commit();

                    return response()-&amp;gt;json(['message' =&amp;gt; 'success']);
                } catch (\Exception $e) {
                    DB::rollBack();
                    Log::error('Error deleting directory: ' . $e-&amp;gt;getMessage());
                    return response()-&amp;gt;json(['message' =&amp;gt; 'failed'], 500);
                }
            }
            return response()-&amp;gt;json(['message' =&amp;gt; 'failed'], 500);
        }
        if ($request-&amp;gt;hasFile('filepond')) {
            $files = $request-&amp;gt;file('filepond');
            foreach ($files as $key =&amp;gt; $file) {
                $filename = $file-&amp;gt;getClientOriginalName();
                $folder = uniqid() . '-' . time();
                $file-&amp;gt;storeAs('orders/temp/' . $folder, $filename);
                TemporaryFile::query()-&amp;gt;create(['folder' =&amp;gt; $folder, 'filename' =&amp;gt; $filename]);
                // Arr::add($folders, $key, $folder);
                return response()-&amp;gt;json(['folder' =&amp;gt; $folder], 200);
            }
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Controller we are checking if filepond exists then get the file and then we have created a folder name. Now we gonna save this uploaded file in this folder and will return the name of the folder. Well, there’s a reason behind returning in json. I was getting some error because of debugbar I guess.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web.php
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use App\Http\Controllers\TemporaryFileController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::controller(TemporaryFileController::class)-&amp;gt;group(function(){
    Route::match(['post','delete'],'temp/upload','index')-&amp;gt;name('temporary.upload');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Error Handling
&lt;/h2&gt;

&lt;p&gt;If you see this kind of error.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0azoz8vzj2oelws44xf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0azoz8vzj2oelws44xf3.png" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That means we are not sending the &lt;code&gt;csrf token&lt;/code&gt; in request.&lt;/p&gt;

&lt;p&gt;Make sure you have &lt;code&gt;&amp;lt;meta name="csrf-token" content="{{ csrf_token() }}"&amp;gt;&lt;/code&gt; this tag in your head so that any time you get this in your js with &lt;code&gt;$('meta[name="csrf-token"]').attr("content"),&lt;/code&gt; this syntax.&lt;/p&gt;

&lt;p&gt;Now you have to fix this. Update your &lt;code&gt;welcome.blade.php&lt;/code&gt; with this tag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Below is the output:&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Repo URL: &lt;a href="https://github.com/robinkashyap-01/filepond-fileupload-laravel" rel="noopener noreferrer"&gt;https://github.com/robinkashyap-01/filepond-fileupload-laravel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;File Pond is an amazing library you should use it if you want to enhance the experience of your application. Thanks.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/upload-files-using-filepond-in-laravel/" rel="noopener noreferrer"&gt;Upload Files Using Filepond In Laravel&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>laravel</category>
      <category>filepond</category>
    </item>
    <item>
      <title>The Importance of Unit Testing in PHP Applications</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Wed, 01 Nov 2023 17:39:24 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/the-importance-of-unit-testing-in-php-applications-3nbk</link>
      <guid>https://forem.com/gurpreetkait/the-importance-of-unit-testing-in-php-applications-3nbk</guid>
      <description>&lt;p&gt;In the world of web development, PHP remains a popular and powerful scripting language. PHP applications power numerous websites, from e-commerce platforms to content management systems. While PHP’s flexibility and versatility are undeniable, ensuring the reliability and stability of PHP applications is equally important. This is where unit testing comes into play. In this blog post, we’ll explore the significance of unit testing in PHP applications and how it contributes to building robust, error-free software.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Foundation of Quality PHP Code
&lt;/h2&gt;

&lt;p&gt;Unit testing is an essential practice in software development. It involves testing individual components or units of code in isolation to ensure they work as expected. These units can be functions, methods, or even classes. For PHP developers, unit testing forms the foundation of high-quality code. Here’s why it’s crucial:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Catching Bugs Early
&lt;/h3&gt;

&lt;p&gt;Unit tests act as a safety net. They catch bugs and issues in your code before they snowball into more significant problems. By identifying and addressing issues early in the development process, you save time and effort in the long run.&lt;/p&gt;

&lt;p&gt;Let’s assume you have a PHP function that calculates the total price of items in a shopping cart. Without unit tests, a bug could go unnoticed, leading to incorrect calculations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// shopping_cart.php

function calculateTotalPrice($items) {
    $total = 0;
    foreach ($items as $item) {
        $total += $item['price'];
    }
    return $total;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A corresponding PHPUnit test for this function can catch potential issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// shopping_cart_test.php

class ShoppingCartTest extends PHPUnit\Framework\TestCase {
    public function testCalculateTotalPrice() {
        $items = [
            ['price' =&amp;gt; 10],
            ['price' =&amp;gt; 20],
        ];

        $total = calculateTotalPrice($items);

        $this-&amp;gt;assertEquals(30, $total);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test ensures that the &lt;code&gt;calculateTotalPrice&lt;/code&gt; function correctly calculates the total price. It’s your safety net, detecting issues like incorrect sums or unexpected behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code Refactoring
&lt;/h3&gt;

&lt;p&gt;Suppose you’re working on a PHP class responsible for user authentication. You want to refactor the code to use a more secure hashing algorithm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// auth.php

class UserAuth {
    public function login($username, $password) {
        // Existing authentication logic
    }

    public function resetPassword($user) {
        // Existing password reset logic
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By having unit tests, you can confidently refactor this code and ensure existing functionality remains intact.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// auth_test.php

class UserAuthTest extends PHPUnit\Framework\TestCase {
    public function testLogin() {
        // Test the login method
    }

    public function testResetPassword() {
        // Test the resetPassword method
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you refactor the &lt;code&gt;UserAuth&lt;/code&gt; class, these tests guarantee that user login and password reset functionality continue to work as expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improved Collaboration
&lt;/h3&gt;

&lt;p&gt;In a team environment, unit tests enhance collaboration. They define how different parts of your PHP application should behave and help prevent misunderstandings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// order.php

class Order {
    public function createOrder($items, $user) {
        // Create an order and return details
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unit tests for this class act as documentation and enable multiple developers to work together efficiently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// order_test.php

class OrderTest extends PHPUnit\Framework\TestCase {
    public function testCreateOrder() {
        // Test the createOrder method
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When developers join the project, these tests provide clear examples of how to use and interact with the &lt;code&gt;Order&lt;/code&gt; class.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhanced Documentation
&lt;/h3&gt;

&lt;p&gt;Unit tests serve as documentation for your code. They demonstrate how individual parts of your application should behave, making it easier for developers to understand and use your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; When a new developer joins your project, unit tests provide clear examples of how to use and interact with different PHP classes and functions. This helps onboard new team members quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learning Testing in PHP
&lt;/h2&gt;

&lt;p&gt;Imagine embarking on a journey to master unit testing in PHP. Along the way, you encounter a magical course that simplifies the complex world of testing. The “Testing in PHP by Gary Clarke” course takes you on an enchanting adventure, teaching you how to write effective tests and leverage PHP testing frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you should Enroll&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing is an essential skill that can only  &lt;strong&gt;advance your career&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fugxj6kixt3mjha5el9af.png" alt="💪" width="72" height="72"&gt; Your code will become more predictable and reliable&lt;/li&gt;
&lt;li&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuk7xf146hoaf4jlceemz.png" alt="🆕" width="72" height="72"&gt; The information is current and relevant to the market&lt;/li&gt;
&lt;li&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj558tnvz4hri5dpf0q1u.png" alt="📈" width="72" height="72"&gt; Promotion. To become a senior PHP developer ** you will need to understand testing strategies**&lt;/li&gt;
&lt;li&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9na7gtl54peu9pr6mqp6.png" alt="🌴" width="72" height="72"&gt; Flexible. You can work at your own pace. Take as long as it takes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The course is designed for both beginners and experienced PHP developers, providing valuable insights and best practices for writing clean, maintainable code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtja9my01n62wnzj8qol.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtja9my01n62wnzj8qol.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://garyclarketech.teachable.com/courses/testing-php?affcode=1162060_lo-_ktwb" rel="noopener noreferrer"&gt;Learn more about the course here&lt;/a&gt;and begin your adventure today.&lt;/p&gt;

&lt;p&gt;Related Articles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/test-php-code-with-phpunit/" rel="noopener noreferrer"&gt;How To Test PHP Code With PHPUnit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/weekly-webtips/writing-unit-tests-in-php-using-phpunit-8dbb426b097b" rel="noopener noreferrer"&gt;Writing unit tests in PHP using PHPUnit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tsh.io/blog/php-unit-testing/" rel="noopener noreferrer"&gt;PHP Unit Testing&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Unit testing is not just a good practice; it’s a necessity in the world of PHP application development. By catching bugs early, facilitating code refactoring, and improving collaboration, unit tests contribute to the creation of stable and reliable software.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/the-importance-of-unit-testing-in-php-applications/" rel="noopener noreferrer"&gt;The Importance of Unit Testing in PHP Applications&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>php</category>
      <category>testing</category>
    </item>
    <item>
      <title>Simple Query Builder</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Mon, 30 Oct 2023 18:44:51 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/simple-query-builder-5eo9</link>
      <guid>https://forem.com/gurpreetkait/simple-query-builder-5eo9</guid>
      <description>&lt;p&gt;Maybe you know that in Laravel Framework we build queries by using a very convenient approach to build queries. Which is called query builder. Yes, so the same I am trying to do with simple-query-builder in PHP. If you have a core php application then easily you can install the library and use it in your project.&lt;/p&gt;

&lt;p&gt;This provides a simple interface to build select, insert, update, or delete queries. You can also use it for queries where we require you to use Joins.&lt;/p&gt;

&lt;p&gt;Repository Url: &lt;a href="https://github.com/robinkashyap-01/simple-query-builder" rel="noopener noreferrer"&gt;simple-query-builder&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; composer require robinksp/simple-query-builder 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to Get Connection
&lt;/h2&gt;

&lt;p&gt;It’s simple to build a connection in simple-query-builder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// file: app/connection.php

&amp;lt;?php

use robinksp\querybuilder\Connection;

require 'vendor/autoload.php';

$config = [
    'hostname' =&amp;gt; 'localhost',
    'username' =&amp;gt; 'root',
    'password' =&amp;gt; 'password',
    'database' =&amp;gt; 'test'
];
$connection = (new Connection($config))::connect();

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to build a basic query
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$selectQuery = (new Query($connection))
    -&amp;gt;table('award_icons')
    -&amp;gt;select('*')
    -&amp;gt;where('id', '=', 33)
    -&amp;gt;get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The post &lt;a href="https://larachamp.com/simple-query-builder/" rel="noopener noreferrer"&gt;Simple Query Builder&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
    </item>
    <item>
      <title>How To Send Bulk Email Using Laravel</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Tue, 24 Oct 2023 13:48:17 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/how-to-send-bulk-email-using-laravel-3p9h</link>
      <guid>https://forem.com/gurpreetkait/how-to-send-bulk-email-using-laravel-3p9h</guid>
      <description>&lt;p&gt;Hey there, If you are building something interesting and looking to send bulk emails using your application’s in-built power provided by Laravel itself. You can do that easily.&lt;/p&gt;

&lt;p&gt;You can use SMTP or external services like Mailgun or Sendgrid as well.&lt;/p&gt;

&lt;p&gt;In this blog, I’ll walk through the process step-by-step, and I’ll provide example code snippets along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Make sure you have a laravel application up and running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project --prefer-dist laravel/laravel bulk_email_app
cd bulk_email_app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure Mail Credentials
&lt;/h2&gt;

&lt;p&gt;Now you have to go to your .env file and add your email credentials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Seeder
&lt;/h2&gt;

&lt;p&gt;In my case, I have seeded a few emails to perform the bulk email action. But in your case, you may be uploading via CSV or you may be just entering them in the tables manually. But at the end when we have emails in the db the case is the same to send them.&lt;/p&gt;

&lt;p&gt;I’ll be using &lt;a href="https://dev.to/scottw/mailtrap-io-4b4o-temp-slug-5292619"&gt;Mailtrap&lt;/a&gt; for email testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faab9ezszsb76a8dguyo0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faab9ezszsb76a8dguyo0.png" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up the Queue Driver
&lt;/h2&gt;

&lt;p&gt;Mostly we use &lt;code&gt;database&lt;/code&gt; the driver. You can configure it in your &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;QUEUE_CONNECTION=database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create An Artisan Command
&lt;/h2&gt;

&lt;p&gt;Create an Artisan command that will dispatch a job to send the bulk emails. Run the following command to create the job:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:command SendBulkEmails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;SendBulkEmails&lt;/code&gt; command, dispatch a job to send the emails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Console\Commands;

use App\Jobs\SendBulkEmailJob;
use App\Models\User;
use Illuminate\Console\Command;

class SendBulkEmails extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'app:send-bulk-emails';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $users= User::query()-&amp;gt;select('email')-&amp;gt;get();
        $data['emails'] = $users;
        $data['subject'] = 'Newsletter Email';
        $data['content'] = 'This is newsletter email';
        SendBulkEmailJob::dispatch($data);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Mail
&lt;/h2&gt;

&lt;p&gt;I have created a mail called &lt;code&gt;NewletterEMail&lt;/code&gt; which we will represent a particular mail template. In view you can pass your view template/blade file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//app/Mail/NewsletterEmail.php

&amp;lt;?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class NewsletterEmail extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     */
    public function __construct(
        public string $content,
        public $subject
    )
    {

    }

    /**
     * Get the message envelope.
     */
    public function envelope(): Envelope
    {
        return new Envelope(
            subject: $this-&amp;gt;subject,
        );
    }

    /**
     * Get the message content definition.
     */
    public function content(): Content
    {
        return new Content(
            view: 'mail'
        );
    }

    /**
     * Get the attachments for the message.
     *
     * @return array&amp;lt;int, \Illuminate\Mail\Mailables\Attachment&amp;gt;
     */
    public function attachments(): array
    {
        return [];
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a Job for Sending Bulk Emails
&lt;/h2&gt;

&lt;p&gt;We have to create a job to send bulk emails.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:job SendBulkEmailJob

&amp;lt;?php

namespace App\Jobs;

use App\Mail\NewsletterEmail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;

class SendBulkEmailJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     */
    public function __construct(
        protected array $data
    )
    {
        $this-&amp;gt;data = $data;
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        $emailContent = $this-&amp;gt;data['content'];
        $subject = $this-&amp;gt;data['subject'];
        $emailList = $this-&amp;gt;data['emails'];

        foreach ($emailList as $email) {
            Mail::to($email-&amp;gt;email)-&amp;gt;send(new NewsletterEmail($emailContent, $subject));
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Migrate Job Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// it will generate table for queued jobs
php artisan queue:table

// migrate
php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Schedule the Email Sending Task
&lt;/h2&gt;

&lt;p&gt;Now, let’s set up the Laravel scheduler to run the email-sending task periodically. Edit the &lt;code&gt;app/Console/Kernel.php&lt;/code&gt; file and add the following code to the &lt;code&gt;schedule&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app/Console/Kernel.php

use App\Console\Commands\SendBulkEmails;

    protected function schedule(Schedule $schedule): void
    {
        // $schedule-&amp;gt;command('inspire')-&amp;gt;hourly();
        $schedule-&amp;gt;command('app:send-bulk-emails')-&amp;gt;dailyAt('16:41');
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Perform
&lt;/h2&gt;

&lt;p&gt;Now, you can run the below command to test the whole process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan queue:listen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! You have set up a scheduled task to send bulk emails in the background using Laravel’s task scheduling and the queue system. Make sure to customize the code and configuration according to your specific needs and requirements.&lt;/p&gt;

&lt;p&gt;Related:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/robinksp01/sending-mails-using-php-with-mail-function-ihi-temp-slug-8758603"&gt;Sending Mails Using PHP With Mail Function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/robinksp01/queue-emails-in-laravel-save-load-time-432"&gt;Queue Emails In Laravel | Save Load Time&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://larachamp.com/send-email-with-attachment-in-laravel/" rel="noopener noreferrer"&gt;Send Email With Attachment In Laravel (Laravel 8)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/robinksp01/how-to-send-mail-in-laravel-with-template-2k6b"&gt;How to send mail in Laravel with a template&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/how-to-send-bulk-email-using-laravel/" rel="noopener noreferrer"&gt;How To Send Bulk Email Using Laravel&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>What Is a PWA and How to Build One</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Thu, 19 Oct 2023 12:57:46 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/what-is-a-pwa-and-how-to-build-one-48m</link>
      <guid>https://forem.com/gurpreetkait/what-is-a-pwa-and-how-to-build-one-48m</guid>
      <description>&lt;p&gt;PWA is a web term that means (progressive web apps) PWA is a special kind of website that you can use over the internet on any device you want, make sure the browser supports the PWA. Maybe some browsers don’t understand them but on Chrome, Firefox, and Safari you can use the PWA.&lt;/p&gt;

&lt;p&gt;So, the cool thing about PWA you don’t need to go to any app store or Play store to download it. You just have to go to the website and you can easily access this on your home screen.&lt;/p&gt;

&lt;p&gt;So, in simple words, a PWA is a special website that you can put on your home screen and use like an app. It’s kind of like magic! &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4b2zzxbri04hv4vm73k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4b2zzxbri04hv4vm73k.png" alt="😊" width="72" height="72"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz132bg1deyh6eq73un5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz132bg1deyh6eq73un5m.png" alt="🌟" width="72" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlc89gcq3999kajkwln5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlc89gcq3999kajkwln5.png" width="412" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image, you can see the download button first icon in the row on the right side. That means the website is a PWA you can even install it on your computer as an app and on your mobile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building A Simple PWA Website
&lt;/h2&gt;

&lt;p&gt;If you are ready for a practical experience let’s open your code editor and create these files.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Index.html&lt;/li&gt;
&lt;li&gt;manifest.js&lt;/li&gt;
&lt;li&gt;service-worker.js&lt;/li&gt;
&lt;li&gt;logo.png&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have created it now it’s your term.&lt;/p&gt;

&lt;p&gt;I have created this dummy content HTML file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85yy4dvgs8om13ya049o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85yy4dvgs8om13ya049o.png" width="800" height="707"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need &lt;code&gt;manifest.json&lt;/code&gt; to make our application a PWA. Install this package &lt;a href="https://github.com/elegantapp/pwa-asset-generator" rel="noopener noreferrer"&gt;PWA-asset-generator&lt;/a&gt; which will also generate the different sizes of logo for your app and manifest.json as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install pwa-asset-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk6367qyl74o28x9ydew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk6367qyl74o28x9ydew.png" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let’s try this.&lt;/p&gt;

&lt;p&gt;Now you have to specify the source file which means the &lt;strong&gt;logo&lt;/strong&gt; and the &lt;strong&gt;output folder&lt;/strong&gt; where it will be creating all the different sizes of images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx pwa-asset-generator [source-file] [output-folder]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvj7al05v9rjybhgxo2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvj7al05v9rjybhgxo2s.png" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is will also return a manifest.json file content that you can use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0id8v67v3ffd3i070ajd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0id8v67v3ffd3i070ajd.png" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see it has created the images directory and different size of logo images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwplp44rl2109q38napk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwplp44rl2109q38napk.png" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t forget to include your manfest.json in the head of your main layout.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;link rel="manifest" href="manifest.json"&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, manifest.json will be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "Simple PWA",
  "short_name": "PWA",
  "description": "A simple Progressive Web App",
  "start_url": "http://localhost/pwa-web/",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#3498db",
  "icons": [
    {
      "src": "images/manifest-icon-192.maskable.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "images/manifest-icon-192.maskable.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "maskable"
    },
    {
      "src": "images/manifest-icon-512.maskable.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "images/manifest-icon-512.maskable.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ]
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now our PWA is ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n0enkwlk4vn5at4cs1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n0enkwlk4vn5at4cs1u.png" width="664" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Service Worker For Caching?
&lt;/h2&gt;

&lt;p&gt;We also need to implement the service-worker for caching.&lt;/p&gt;

&lt;p&gt;service-worker.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.addEventListener('install', (e) =&amp;gt; {
    e.waitUntil(
        caches.open('my-cache').then((cache) =&amp;gt; {
            return cache.addAll([
                '/',
                '/manifest.json',
                '/logo.png'
            ]);
        }).catch((error) =&amp;gt; {
            console.log('cache error', error);
        })
    );
});

self.addEventListener('fetch', (e) =&amp;gt; {
    e.respondWith(
        caches.match(e.request).then((response) =&amp;gt; {
            return response || fetch(e.request);
        })
    );
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the below script you have to add to your index.html file or whatever main layout file you are using default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
    if ('serviceWorker' in navigator) {
        navigator.serviceWorker.register('service-worker.js')
            .then((reg) =&amp;gt; {
                console.log('Service Worker registered with scope:', reg.scope);
            })
            .catch((error) =&amp;gt; {
                console.error('Service Worker registration failed:', error);
            });
    }
&amp;lt;/script&amp;gt;
//Before your body tag
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So, In conclusion, PWA is most likely an all-in-one package for the web that doesn’t require any kind of different distributions or bundling we can easily have an app-like experience by installing it.&lt;/p&gt;

&lt;p&gt;And more you will get to know when you’ll be using it. Thanks for reading.&lt;/p&gt;

&lt;p&gt;Suggested: &lt;a href="https://dev.to/robinksp01/building-your-first-composer-package-5l9-temp-slug-4903572"&gt;How to build your composer package&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s connect: &lt;a href="https://twitter.com/robinkashyap_01" rel="noopener noreferrer"&gt;Robin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/what-is-a-pwa-and-how-to-build-one/" rel="noopener noreferrer"&gt;What Is a PWA and How to Build One&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>pwa</category>
    </item>
    <item>
      <title>Use Yajra DataTables In Laravel – Simple Guide</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Tue, 10 Oct 2023 14:23:08 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/use-yajra-datatables-in-laravel-simple-guide-27fa</link>
      <guid>https://forem.com/gurpreetkait/use-yajra-datatables-in-laravel-simple-guide-27fa</guid>
      <description>&lt;p&gt;In the daily dev requirement, we usually show data on the front end, and with Datatables it looks more interactive and smooth. In the same way, we are going to explore Yajra Datatables in the Laravel ecosystem and how we can use them.&lt;/p&gt;

&lt;p&gt;Yajra Datatables is a package that makes it easy to create dynamic server-side data tables with ease. It can be an easy add-on for your next Laravel project.&lt;/p&gt;

&lt;p&gt;If you are new to this concept don’t worry, I’ll explain everything that will help you to use this easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Install
&lt;/h2&gt;

&lt;p&gt;In Laravel, this can be installed with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require yajra/laravel-datatables-oracle:"^10.3.1"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can go to their &lt;a href="https://yajrabox.com/docs/laravel-datatables/10.0/installation#requirements" rel="noopener noreferrer"&gt;Installation&lt;/a&gt; page where you can see all the requirements stuff, I don’t want to repeat that.&lt;/p&gt;

&lt;p&gt;For configuration you can see the &lt;a href="https://yajrabox.com/docs/laravel-datatables/10.0/installation#configuration" rel="noopener noreferrer"&gt;configuration&lt;/a&gt; section otherwise in the short do these steps after installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Step - 1
// config/app.php

'providers' =&amp;gt; [
    // ...
    Yajra\DataTables\DataTablesServiceProvider::class,
],

Step - 2

php artisan vendor:publish --tag=datatables

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Yajra Datatable
&lt;/h2&gt;

&lt;p&gt;Practically, I will say that it has a lot of things that make it easier to use Datatables once you get comfortable with defining columns and all, you will see it makes life easier.&lt;/p&gt;

&lt;p&gt;So, I’ll list down all the concepts that I saw really provide value to the developer and not extra theoretical lines here.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It has the ability to modify columns by building Eloquent queries in it. Let me show you a small example of my code.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; /**
     * Get the query source of dataTable.
     */
    public function query(ImportedAttendance $model): QueryBuilder
    {
        $request = $this-&amp;gt;request();
        // Log::info('request in payroll: '. json_encode($request-&amp;gt;all(['designation','employee_company_id','employee_id','department','month','year'])));
        $designation = $request-&amp;gt;designation ?? '';
        $employeeCompany = $request-&amp;gt;employee_company_id ?? '';
        // $employeeId = $request-&amp;gt;employee_id ?? '';
        $department = $request-&amp;gt;department ?? '';
        $month = $request-&amp;gt;month ?? '';
        $year = $request-&amp;gt;year ?? '';
        // return $model-&amp;gt;newQuery()-&amp;gt;with(['employeeDetails', 'employeeDetails.user']);
        $query = $model-&amp;gt;newQuery();
        $query-&amp;gt;whereHas('employeeDetails', function ($query) use ($designation, $employeeCompany, $department) {
            if ($designation !== 'all') {
                $query-&amp;gt;where('designation_id', $designation);
            }

            if ($employeeCompany !== 'all') {
                $query-&amp;gt;where('client_id', $employeeCompany);
            }

            // if ($employeeId !== 'all') {
            // $query-&amp;gt;where('employee_details.user_id', $employeeId);
            // }

            if ($department !== 'all') {
                $query-&amp;gt;where('department_id', $department);
            }
        });
        $firstDayOfNextMonth = Carbon::createFromDate($year, $month, 1)-&amp;gt;addMonth();
        $lastDayOfMonth = $firstDayOfNextMonth-&amp;gt;subDay();
        $lastDayOfMonthString = $lastDayOfMonth-&amp;gt;format('Y-m-d');
        $query-&amp;gt;where('month', $lastDayOfMonthString)-&amp;gt;with(['employeeDetails.user']);
        return $query;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When we use query builder / Eloquent Models in it, It becomes more handy to show data on fronted instead of tackling all of these in the blade file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it comes with an HTML builder, you can build the columns in it. In my point of view, it makes the blade much more clear because everything goes from the DataTable Class to our view file.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are a lot of other things that you will understand when you use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case Example – How to use Yajra Datatables
&lt;/h2&gt;

&lt;p&gt;Now let’s see how can you use this Datatable package practically in your Project.&lt;/p&gt;

&lt;p&gt;So, the installation guide is already explained now. It provides an artisan command with which we can create a Datatable Class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan datatable:make Dummy #it will automatically add DataTable in the end of the name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr20o6f9ypvaooztluis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr20o6f9ypvaooztluis.png" width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have already created a Datatable class let me take you there. It’s a simple crud for &lt;code&gt;companies&lt;/code&gt; Table.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;CompanyController&lt;/code&gt; –&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CompanyDataTable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CompanyModel&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;companies/index.blade.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are the above files I’m gonna use for this small Crud Operation.&lt;/p&gt;

&lt;p&gt;I am assuming that you can create a model/controller.&lt;/p&gt;

&lt;h3&gt;
  
  
  DataTable Class
&lt;/h3&gt;

&lt;p&gt;I’m assuming that you have created the Datatable class. Doesn’t matter what the main thing is the concept should be clear in mind.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\DataTables;

use App\Models\EmployeeCompany;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;

class EmployeeCompanyDataTable extends DataTable
{
    /**
     * Build the DataTable class.
     *
     * @param QueryBuilder $query Results from query() method.
     */
    public function dataTable(QueryBuilder $query): EloquentDataTable
    {
        return (new EloquentDataTable($query))
            -&amp;gt;addIndexColumn()
            -&amp;gt;addColumn('action', function ($row) {
                $action = '&amp;lt;div class="task_view"&amp;gt;
                    &amp;lt;div class="dropdown"&amp;gt;
                        &amp;lt;a class="task_view_more d-flex align-items-center justify-content-center dropdown-toggle" type="link"
                            id="dropdownMenuLink-" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&amp;gt;
                            &amp;lt;i class="icon-options-vertical icons"&amp;gt;&amp;lt;/i&amp;gt;
                        &amp;lt;/a&amp;gt;
                        &amp;lt;div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink-" tabindex="0"&amp;gt;';
                $action .= '&amp;lt;a class="dropdown-item openRightModal" href="' . route('company.edit', [$row['id']]) . '"&amp;gt;
                                &amp;lt;i class="fa fa-edit mr-2"&amp;gt;&amp;lt;/i&amp;gt;
                                ' . trans('app.edit') . '
                            &amp;lt;/a&amp;gt;';
                $action .= '&amp;lt;a class="dropdown-item delete-table-row" href="javascript:;" data-company-id="' . $row['id'] . '"&amp;gt;
                                &amp;lt;i class="fa fa-trash mr-2"&amp;gt;&amp;lt;/i&amp;gt;
                                ' . trans('app.delete') . '
                            &amp;lt;/a&amp;gt;';
                $action .= '&amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;';
                return $action;
            })
            -&amp;gt;setRowId('id')
            -&amp;gt;rawColumns(['action']);
    }

    /**
     * Get the query source of dataTable.
     */
    public function query(Company $model): QueryBuilder
    {
        return $model-&amp;gt;newQuery();
    }

    /**
     * Optional method if you want to use the html builder.
     */
    public function html(): HtmlBuilder
    {
        return $this-&amp;gt;builder()
            -&amp;gt;setTableId('company-table')
            -&amp;gt;columns($this-&amp;gt;getColumns())
            -&amp;gt;minifiedAjax()
            //-&amp;gt;dom('Bfrtip')
            -&amp;gt;orderBy(1)
            -&amp;gt;selectStyleSingle()
            -&amp;gt;buttons([
                // Button::make('create'),
                // Button::make('export'),
                // Button::make('print'),
                // Button::make('reset'),
                Button::make('reload')
            ]);
    }

    /**
     * Get the dataTable columns definition.
     */
    public function getColumns(): array
    {
        return [
            Column::make('id'),
            Column::make('name'),
            Column::make('email'),
            Column::make('phone'),
            Column::make('website'),
            Column::make('gst_number'),
            Column::computed('action')
                -&amp;gt;exportable(false)
                -&amp;gt;printable(false)
                -&amp;gt;width(60)
                -&amp;gt;addClass('text-center'),
        ];
    }

    /**
     * Get the filename for export.
     */
    protected function filename(): string
    {
        return 'Company_' . date('YmdHis');
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s understand the above Datatable Class now. I have tried going a little deeper into the methods. So, I can explain but few things I don’t know how to work under the hood. And also not important.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Method &lt;code&gt;dataTable()&lt;/code&gt; returns the query instance with the result and performs an action with we can use each data in &lt;code&gt;rawColumns&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;There’s a method called &lt;code&gt;computed()&lt;/code&gt; which says that this column needs some extra modifications that we define in &lt;code&gt;dataTable()&lt;/code&gt; method.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;query()&lt;/code&gt; method we can build queries for our uses, Maybe you want to use relations between models and joins so, you need to define in the query() method and then you can access that in your &lt;code&gt;dataTable()&lt;/code&gt; method.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getColumns()&lt;/code&gt; You have &lt;code&gt;Column::make('id'),&lt;/code&gt; a static method that makes () accept &lt;code&gt;name&lt;/code&gt; of the field as in the table of the database.&lt;/li&gt;
&lt;li&gt;If you want to you can add a title to the make(‘this_name_can_be_defined_in_datatable_method’)-&amp;gt;title(custom_title__for_the_column)-&amp;gt;data(field_name_as_in_table).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ws4e1oze8nkogp1opba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ws4e1oze8nkogp1opba.png" width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things should be much more clear for now. In the next blog, I’ll be explaining more about Yajra Tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Controller Class
&lt;/h3&gt;

&lt;p&gt;Once you have created the controller go to the &lt;code&gt;index method()&lt;/code&gt;. And use your DataTable Class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function index(CompanyDataTable $datatables)
    {
        $somedata = Somedata::all();
        return $datatables-&amp;gt;render('employees-companies.index', compact('somedata'));
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;code&gt;compact()&lt;/code&gt; functions accept the string as a variable name&lt;/em&gt;. &lt;code&gt;//output will be ['somedata' =&amp;gt; $somedata]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to send data to the view file, You can use the above way in &lt;code&gt;render()&lt;/code&gt; method in the second parameter you can add whatever data you want.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;strong&amp;gt;render()&amp;lt;/strong&amp;gt;&lt;/code&gt; method renders the view file with data that has been returned from dataTable.&lt;/p&gt;

&lt;h3&gt;
  
  
  View Implementation
&lt;/h3&gt;

&lt;p&gt;In your view file, you can use it simply as mentioned below in the snippet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; {!! $dataTable-&amp;gt;table(['class' =&amp;gt; 'table table-hover border-0 w-100']) !!}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope that it will help you understand the basic use cases of &lt;strong&gt;&lt;a href="https://yajrabox.com/" rel="noopener noreferrer"&gt;Yajra Datatables&lt;/a&gt;&lt;/strong&gt;. You will understand more once you start using this in your own projects. Thanks.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/use-yajra-datatables-in-laravel-simple-guide/" rel="noopener noreferrer"&gt;Use Yajra DataTables In Laravel – Simple Guide&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>yajradatatables</category>
    </item>
    <item>
      <title>Boost Your Productivity with Essential PHPStorm Shortcuts</title>
      <dc:creator>Gurpreet Kait</dc:creator>
      <pubDate>Sun, 27 Aug 2023 06:31:46 +0000</pubDate>
      <link>https://forem.com/gurpreetkait/boost-your-productivity-with-essential-phpstorm-shortcuts-3e67</link>
      <guid>https://forem.com/gurpreetkait/boost-your-productivity-with-essential-phpstorm-shortcuts-3e67</guid>
      <description>&lt;p&gt;As a PHP developer, your choice of tools can significantly impact your productivity and coding experience. PHPStorm, a feature-rich integrated development environment (IDE), offers a plethora of keyboard shortcuts that can help you streamline your workflow and accomplish tasks with ease. In this blog, we’ll dive into some of the most valuable PHPStorm shortcuts that every developer should know. Let’s unlock the power of keyboard magic!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;General Shortcuts: Save Time and Effort&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmanfdsdimzitvkq8kpeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmanfdsdimzitvkq8kpeu.png" alt="phpstorm shotcuts" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Efficiency begins with the basics. These general shortcuts are the foundation of navigating and managing your code effortlessly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + S&lt;/code&gt; – Instantly save your work to avoid losing any changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Z&lt;/code&gt; and &lt;code&gt;Ctrl + Shift + Z&lt;/code&gt; – Correct mistakes or backtrack through your changes easily.&lt;/li&gt;
&lt;li&gt;`&lt;code&gt;Ctrl + C&lt;/code&gt;, &lt;code&gt;Ctrl + X&lt;/code&gt;, &lt;code&gt;Ctrl + V&lt;/code&gt; – Manage your code snippets efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + D&lt;/code&gt; – Create duplicates without repetitive typing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Alt + Left/Right&lt;/code&gt; – Jump between recently visited code locations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Navigation Shortcuts: Find Your Way Around&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;PhpStorm provides many shortcuts for navigation. Navigating through your codebase quickly is crucial for maintaining your flow. These shortcuts help you zip around effortlessly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + N&lt;/code&gt; – Quickly locate a specific class.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Shift + N&lt;/code&gt; – Instantly find and open files in your project.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + B&lt;/code&gt; or &lt;code&gt;Ctrl + Click&lt;/code&gt; – Easily navigate to a class or method’s definition.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + F12&lt;/code&gt; – Get an overview of the current file’s structure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Code Editing Shortcuts: Write Code Faster&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As a PHP developer, I would say that PhpStrom helps in many ways in creating classes and building a SOLID code base. You should use editing shortcuts that enhance your development experience. These shortcuts empower you to edit your code swiftly and accurately:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Space&lt;/code&gt; and &lt;code&gt;Ctrl + Shift + Space&lt;/code&gt; – Utilize smart code completion to speed up your typing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + P&lt;/code&gt; – See parameter details within a function or method call.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + F&lt;/code&gt; and &lt;code&gt;Ctrl + R&lt;/code&gt; – Locate and replace text within your current file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + W&lt;/code&gt; (multiple presses) and &lt;code&gt;Ctrl + Shift + W&lt;/code&gt; – Select code blocks quickly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Alt + L&lt;/code&gt; – Automatically format your code to adhere to coding standards.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Code Generation and Refactoring: Elevate Your Code Quality&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Writing and maintaining clean code is essential. These shortcuts help you generate and refactor your code efficiently:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Alt + Insert&lt;/code&gt; – Quickly create getters, setters, constructors, and more.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + O&lt;/code&gt; and &lt;code&gt;Ctrl + I&lt;/code&gt; – Override methods and implement interfaces seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Shift + F6&lt;/code&gt; – Rename variables, classes, and methods with ease.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Alt + M&lt;/code&gt; and &lt;code&gt;Ctrl + Alt + V&lt;/code&gt; – Refactor your code by extracting methods and variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Version Control (Git) Shortcuts: Manage Your Codebase&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Integrating version control into your workflow is essential. These Git shortcuts simplify version control tasks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + K&lt;/code&gt; – Commit your code changes directly from the IDE.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + T&lt;/code&gt; – Fetch and update your project from the version control system.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Shift + K&lt;/code&gt; – Push your committed changes to the remote repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Alt + Z&lt;/code&gt; – Roll back unwanted changes with ease.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Debugging Shortcuts: Debug with Precision&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Debugging is a critical part of development. These shortcuts make the debugging process more efficient:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Shift + F8&lt;/code&gt; – Add or remove breakpoints for debugging&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;F9&lt;/code&gt; – Continue program execution while debugging.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;F7&lt;/code&gt; and &lt;code&gt;Shift + F7&lt;/code&gt; – Step into functions or smart step into relevant code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion: Embrace Efficiency with PHPStorm Shortcuts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the fast-paced world of PHP development, mastering shortcuts is like having a secret weapon in your arsenal. PHPStorm offers a treasure trove of shortcuts that can significantly enhance your coding speed and overall efficiency. By incorporating these shortcuts into your workflow, you’ll be navigating, editing, and debugging your code like a pro in no time. Happy coding!&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/robinksp01/array-map-function-in-php-4die"&gt;Array Map Function In PHP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/robinksp01/understanding-dependency-injection-2gf3-temp-slug-1241809"&gt;What Is Dependency Injection&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://larachamp.com/boost-your-productivity-with-essential-phpstorm-shortcuts/" rel="noopener noreferrer"&gt;Boost Your Productivity with Essential PHPStorm Shortcuts&lt;/a&gt; appeared first on &lt;a href="https://larachamp.com" rel="noopener noreferrer"&gt;Larachamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
  </channel>
</rss>
