How-to articles, tricks, and solutions about LARAVEL
You can use the Laravel Blade Snippets extension for Visual Studio Code to format Blade code in your Laravel projects.
In Laravel, you can use the withTrashed() method to retrieve all the rows, including the soft deleted ones, from a table.
In Laravel, you can get the client's IP address by using the Request facade's ip method.
You can use the now() method from the Carbon class to get the current timestamp in Laravel.
To get the URL of a file using the Storage facade in Laravel 5, you can use the url method.
In Laravel, you can use the save method provided by Eloquent to insert a new record and retrieve the last insert ID.
If you want to grasp the way of getting a query builder to output its raw SQL query as a string using PHP, then you are in the right place.
To get the query executed in Laravel 5, you can use the DB::getQueryLog() method.
In Laravel, an "Undefined offset" error typically occurs when trying to access an array index that does not exist.
To install all of the required PHP extensions for Laravel, you will need to install the following PHP extensions on your server:
To install Laravel's Artisan, you will need to install the Laravel framework on your machine first.
To install PHP Composer inside a Docker container, you will need to do the following:
You can use the whereIn method on a query builder instance to create an "IN" clause for a given column and values.
In Laravel, you can use the refresh method on a model instance to reload the model's attributes from the database.
In Laravel 5.1, you can use the selectRaw method to select the year and month from the created_at attribute of a database table.
To set a cookie in Laravel, you can use the Cookie facade.
To send email using Gmail in Laravel, you can use the built-in Swift Mailer library.
To upload files directly into the public folder in Laravel, you can use the storeAs method provided by the Storage facade.
Using multiple databases in Laravel is quite easy.
In Laravel, you can use the validate method on the Validator facade to validate an array of form data.
To validate a file size in Laravel, you can use the size rule in your request validation.
To create your own version of the Laravel DD() function, you can create a new function in your codebase and have it take in any number of arguments.
In Laravel, you can use the unique validation rule to validate that an email address is unique when a user is updating their account.
Yes, you can add values to a request array in Laravel by using the merge method on the request object.
To install a specific version of Laravel using the Composer create-project command, you can specify the version number after the package name.