Windows powershell get first / last 100 lines of txt file
Updated: 1th July 2020Tags: windows powershell
PHP server in current directory
php -S localhost:8000
PHP server in public directory
php -S localhost:8000 -t public
If you try to import dumped file, and there is such an error, try using mysql console with options and then import sql file
mysql -u root -p --max_allowed_packet=6400M
If you haven't acess to console or the previous doesn't work
set global max_allowed_packet=10000000000;
SELECT * FROM my_table ORDER BY id DESC LIMIT 1;
SELECT MAX(id) FROM my_table;
$randomRow = DB::table('table')
->inRandomOrder()
->first();
$randomId = DB::table('table')
->inRandomOrder()
->value('id');
SELECT * FROM my_table ORDER BY RAND() LIMIT 1;
After installing laravel you MUST change some folder permissions.
sudo chmod 755 -R laravel_app
sudo chmod -R o+w laravel_app/storage
sudo chmod -R o+w laravel_app/bootstrap/cache