To get rid of .DS_Store
files in your Laravel project and prevent them from being added in the future, follow these steps:
Run the following command in your project's root directory to delete all .DS_Store
files:
find . -name ".DS_Store" -delete
The paginate()
method is not available directly on the Illuminate\Database\Eloquent\Collection class. Instead, it is a method provided by the query builder (Illuminate\Database\Eloquent\Builder) or the model itself (Illuminate\Database\Eloquent\Model).
To merge two paginated collections and paginate the result, you can take a different approach:
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
$collection1 = Model1::paginate($perPage);
$collection2 = Model2::paginate($perPage);
I wanna have a stable database so I'd rather using sqlite instead other database when I'm developing my Laravel project.
Step 1:
change these line in .env
DB_CONNECTION=sqlite
# DB_HOST=pgsql
# DB_PORT=5432
# DB_DATABASE=example
# DB_USERNAME=sail
Install php: resource
sudo apt update && sudo apt -y upgrade
sudo systemctl reboot
sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
$response->assertOk(); | |
$response->assertRedirect(back()); | |
$this->assertModelMissing($user); | |
$responce->assertJsonStructure([]); | |
$responce->assertTrue(); |
If you encounter one of the problems in git on your system(ubuntu) : fatal: unable to access ‘xxx‘: gnutls_handshake() failed: Error in the pull function. or OpenSSL SSL_connect: Connection reset by peer in connection to api.github.com:443 you can use these steps and solve your problem:
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$fileNames = array(); | |
foreach ($attachments as $file) { | |
$fileNames[] = $file->name; | |
} |
docker exec -i site_mysql_1 mysql -u root -p secret --init-command="set autocommit=0" dbname < ~/sample.sql |