September 2023

Generate temporary signed URL from s3 in Laravel

Last Updated on September 28, 2023 by Moh To create temporary files, you can use temporaryUrl method from the IlluminateSupportFacadeStorage facade. You can use the method on the following syntax. use IlluminateSupportFacadesStorage;$temporarySignedUrl = Storage::disk(‘s3’)->temporaryUrl(“filepath.pdf”, now()->addMinutes(10));   temporaryUrl method accepts two parameters as follows, Path: This parameter accepts the full path of the file in the s3 bucket Expiry Time:

Generate temporary signed URL from s3 in Laravel Read More »

Laravel `.env`, system-level, and server-level environment variables

Last Updated on September 28, 2023 by Moh I was curious about this as well. Here’s your answer: System Level Env Variables: These are set on the actual operating system themselves. For example, in Windows, system level variables can be configured in: Control Panel System Properties Click Environment Variables You will see all the system level

Laravel `.env`, system-level, and server-level environment variables Read More »

How to solve “Error: MySQL shutdown unexpectedly”?

Last Updated on September 20, 2023 by Moh Solve “Error: MySQL shutdown unexpectedly: Rename folder mysql/data to mysql/data_old Make a copy of mysql/backup folder and name it as mysql/data Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders) Copy mysql/data_old/ibdata1 file into mysql/data folder Start MySQL from XAMPP control panel https://stackoverflow.com/questions/18022809/how-to-solve-error-mysql-shutdown-unexpectedly 

How to solve “Error: MySQL shutdown unexpectedly”? Read More »

How do I return a value from a call to Laravel DB::transaction(function () use() { … } );

Last Updated on September 18, 2023 by Moh Actually the DB::transaction(…) returns whatever is returned from the callback. So you could simplify it to: $result = DB::transaction(function () {   // …logic here  return someGetResult();  });  dd($result);

How do I return a value from a call to Laravel DB::transaction(function () use() { … } ); Read More »