How to generate a PDF file in Laravel?

< 1 min readGenerating a PDF file in Laravel can be done using a popular PHP library called “Dompdf”. Here are the steps to generate a PDF file in Laravel using Dompdf: Step 1: Install the Dompdf library via Composer. You can do this by running the following command in your terminal: Step 2: Create a new route…

Read More

How to create a custom cron job in Laravel?

< 1 min readIn Laravel, you can create a custom cron job using the Artisan command make:command. This will generate a new class in the app/Console/Commands directory that extends the Illuminate\Console\Command class. Here are the steps to create a custom cron job: Run this command to generate a new command This will create a new file called MyCustomCronJob.php…

Read More

How to get public path in Laravel?

< 1 min readTo get a public path in Laravel, you can use the public_path() function. Here’s an example: This will return the full path to the file.txt file in the public directory. You can also use the asset() function to generate a URL to a file in the public directory. Here’s an example: This will return a…

Read More

What are mutations in GraphQL?

< 1 min readIn GraphQL, a mutation is a type of operation that allows clients to make changes to the data on the server. Mutations are typically used to create, update, or delete data in a database. They are similar to the “write” operations in a traditional REST API. Unlike queries, which only retrieve data, mutations change the…

Read More

Top terminal keyboard shortcuts for developers

2 min readTerminal shortcuts are an essential tool for developers, as they allow for quick and efficient navigation and manipulation of files and directories. Here are some of the top terminal shortcuts that every developer should know: Ctrl + A This shortcut moves the cursor to the beginning of the current line. Ctrl + E This shortcut…

Read More

How to use Redis for message queues with example

< 1 min readRedis can be used for message queues by leveraging its support for lists and its built-in RPOPLPUSH command. Here’s an example of using Redis for message queues in Python: This example demonstrates a simple use case of Redis for message queues: a producer adds a message to a list-based queue, and a consumer retrieves and…

Read More