laravel tap method for collections

Laravel collections have a method named tap. With this method, we can do actions on the collection without changing it. let’s see an example. imagine we have a collection like this: we sort the collection and then use the tap method on the collection. in the closure inside tap, we dump the collection to see … Read more

what is atomic lock in laravel

Atomic Lock is a way to make sure specific operations just happen by one user during a certain time. let’s say we have an app that reserves seats for events like theater or conferences. obviously, we don’t want to mistakenly give one seat to two people. you might ask how could this happen. this might … Read more

Laravel Trait vs Service

what is trait and where should we use it in Laravel? Trait is a feature in PHP that lets us define methods once and use them in multiple classes. for example, Laravel controllers use traits for adding capabilities like request validation or authorization. take a look at Controller.php in Laravel: AuthorizesRequests, DispatchesJobs and ValidatesRequests are … Read more

wordpress local installation error: uncaught mysqli_sql_exception error

recently I installed a new wordpress installation using laragon. but after opening homepage I got this error: Fatal error: Uncaught mysqli_sql_exception: Table ‘wp1.wp_options’ doesn’t exist I checked PHPMyAdmin and the database existed but the installation page didn’t show up. after searching on the web for a few minutes I found out it was because of … Read more