Articles on Trending Technologies

Technical articles with clear explanations and examples

How to get a list of registered route paths in Laravel?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 4K+ Views

In Laravel, you can retrieve a list of all registered route paths using several methods. All routes are stored in the routes/ folder, and you'll need to include the Route facade to work with them ? Make sure Laravel is installed and configured properly before running these examples. Using Artisan Command The simplest way to view all routes is using the artisan command ? php artisan route:list +--------+----------+---------------------+------+-------------------------------------------------------------+------------------------------------------+ | Domain | Method | URI ...

Read More

How to delete a file from the public folder in Laravel?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 6K+ Views

In Laravel, you can delete files from the public folder using the File facade or PHP's built-in unlink() function. The File facade provides convenient methods for file operations. To work with File facade you need to include the class as shown below − use Illuminate\Support\Facades\File; Using File::delete() Method The delete() method from the File facade can delete single files or multiple files. It accepts a file path or an array of file paths ? File deleted successfully Using PHP unlink() Function The unlink() function is ...

Read More

Line Splicing in C/C++

Revathi Satya Kondra
Revathi Satya Kondra
Updated on 15-Mar-2026 825 Views

In C programming, line splicing is a preprocessor feature that allows you to split one long line of code into multiple lines by using a backslash (\) at the end of a line. The backslash tells the preprocessor to treat the next line as a continuation of the current line. Line splicing is processed before compilation during the preprocessing phase. It does not have parameters or return values − it simply affects how lines of code are interpreted by joining them together. Syntax line_of_code \ continuation_of_line The backslash must be the last character on ...

Read More

How to pass an array as a URL parameter in Laravel?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 12K+ Views

In Laravel, you can pass arrays as URL parameters using several PHP built-in functions. This is useful when you need to send structured data through URLs for API calls or redirects. Using http_build_query() The http_build_query() function converts an array into a URL-encoded query string, making it the most common approach for passing arrays in URLs. Basic Example Here's a simple demonstration of how http_build_query() works ? field1=test&field2=xyz Laravel Controller Example The following example shows how to use http_build_query() in a Laravel controller to construct URLs with array ...

Read More

Read/Write structure to a file using C

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 13K+ Views

In C programming, structures can be written to and read from files using the fwrite() and fread() functions. This allows you to store complex data types persistently and retrieve them later. fwrite() Syntax size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); Parameters: ptr − A pointer to the data to be written size − Size in bytes of each element nmemb − Number of elements to write stream − Pointer to the FILE object fread() Syntax size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); ...

Read More

How to get the last inserted ID using Laravel Eloquent?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 17K+ Views

Eloquent is Laravel's object relational mapper (ORM) that helps interact with databases. Each table has a mapping Model that handles all operations on that table. When you need to insert data and get the ID of the newly created record, Laravel provides several methods to retrieve the last inserted ID. Syntax Using Laravel Eloquent model, you can use the insertGetId() method to get the inserted ID − Model::insertGetId([field=>value, field2=>value…]) The method insertGetId() returns the last inserted ID from the table. Using insertGetId() with Eloquent Model The simplest approach to get the last ...

Read More

How can I get the list of files in a directory using C or C++?

Revathi Satya Kondra
Revathi Satya Kondra
Updated on 15-Mar-2026 17K+ Views

Listing files in a directory is used to write a program that opens a specified folder (e.g: "/myfiles"), reads its contents, and displays the names of each file and subfolder one by one. In C, to see all the files in a directory, you can use special system functions that let you read the directory's contents. In real life, we open folder to see the contents inside the files. Similarly, in C, we can write a program to display all the files and folders in a directory. Syntax DIR *opendir(const char *dirname); struct dirent *readdir(DIR ...

Read More

How to select certain fields in Laravel Eloquent?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 8K+ Views

Laravel Eloquent provides several methods to select specific fields from database tables instead of retrieving all columns. This approach improves performance by reducing memory usage and network traffic. Using select() Method The select() method allows you to specify which fields to retrieve − The output of the above code is − Siya Khan=>siya@gmail.com This is equivalent to the SQL query − SELECT name, email FROM users WHERE id=1; Using get() with Field Array Another approach is passing field names directly to the get() method ...

Read More

C Program to find size of a File

Revathi Satya Kondra
Revathi Satya Kondra
Updated on 15-Mar-2026 3K+ Views

The size of a file refers to the number of bytes it occupies in memory. In C, size of a file can be found by moving the file pointer to the end of the file and checking its position. The position indicates the number of bytes the file contains. The most common way to do this is by using two functions: fseek() (to move to the end) and ftell() (to get the current position, which is the size of the file). Syntax FILE *fp = fopen("filename", "rb"); fseek(fp, 0, SEEK_END); long size = ftell(fp); fclose(fp); ...

Read More

exit() vs _Exit() function in C and C++

George John
George John
Updated on 15-Mar-2026 592 Views

In C, both exit() and _Exit() functions terminate a program, but they differ in how they handle cleanup operations. The exit() function performs cleanup operations before termination, while _Exit() terminates immediately without any cleanup. Syntax void exit(int status); void _Exit(int status); The exit() function calls registered cleanup functions (via atexit()), flushes buffers, and closes open streams before termination. The _Exit() function immediately terminates the program without performing any cleanup operations. Example 1: Using exit() Function Here's how exit() executes cleanup functions registered with atexit() − #include #include void ...

Read More
Showing 21991–22000 of 61,297 articles
Advertisements