Posts

Showing posts from July, 2023

Create resource ( to Json)

php artisan  make:resource PostResource pubic function toarray(Request $request):array { return [ 'id'=>$this->id, 'title'=>$this->title ] } in Post Controller  index(){ return PostResource::collection(Post:all()); }

Ubuntu APP on Windows

Image
  Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL): - Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Launch Microsoft Windows Store: install ubuntu -sudo apt-add-repository ppa:redislabs/redis -sudo apt-get update -sudo apt-get upgrade -sudo apt-get install redis-server -sudo service redis-server start -sudo service redis-server stop -sudo service redis-server restart error WslRegisterDistribution failed with error: 0x80370114