Replace your broken PS4 optical drive mantaining the logic board of your old drive!
In case your PS4 optical drive is failing you can swap it with a new one
BUT PLEASE REMEMBER: logic board has a code that is "married" with the code in the PS4 firmware itself! so you can replace the optical drive but you must keep the original logic board of the old drive! In this case it will work fine!
In the case your logic board is broken, change the drive will not fix your problem, you can theoretically de-solder the original chip containing the code and solder to another logical board (replacing the chip present on the new board, in less words you have to de-solder two chips and solder the old one in the place of the new one) but it's not a five minutes job and you must have proper soldering skills and stuff to do it so it's not properly recommended!