Explore all blogs
419 page expired error in Laravel
419 page expired error in Laravel occurs when the valid CSRF token is missing in the post request. Laravel checks the CSRF token in VerifyCsrfToken middleware.
Delete an element from an array in PHP
To delete an element from an array in PHP, use built-in functions unset(), array_splice(), or array_diff(). Learn how to remove items using these functions.
Get raw SQL query from Laravel Query Builder
To get raw SQL query from Laravel Query Builder, call toSql() method on the query builder. Use enableQueryLog and getQueryLog methods to get the logged queries.
How to create multiple where clause query using Laravel eloquent
Multiple where clauses can create by chaining the where() method. You can use orWhere, whereNot, etc to create complex where queries in Laravel Eloquent.
How to solve error: array_merge() does not accept unknown named parameters
The solve the error “array_merge() does not accept unknown named parameters” upgrade composer to the latest version or downgrade the PHP version to 7.X.
Laravel Cron Job Task Scheduling Tutorial
To set up cron job task scheduling in Laravel, create a custom artisan command, schedule to run the task in kernel.php, and add task scheduler into crontab.
Laravel Model Events and Observers Tutorial
Learn Laravel eloquent model events, how to create an Observer class, add listeners for different events, and register observers in the EventServiceProvider.
Laravel Order by Pivot Table Field
Learn how to order results by pivot table field in eloquent. Two methods 1) using orderBy in Eager loading 2) Using orderByPivot in lazy loading
The POST method is not supported for this route. Supported methods: GET, HEAD
To solve Laravel error “The POST method is not supported for this route. Supported methods: GET, HEAD”, define the route using ‘post’ or ‘any’ methods.