Wednesday, 12 February 2025

Laravel find string in table and columns

 This code will iterate to all tables and columns$excludedColumns = array("created_at", "updated_at", "deleted_at","order","key");$tables = DB::select('SHOW TABLES');foreach ($tables as $table) { $tableName = data_get($table,'Tables_in_XXXX',''); $columns = Schema::getColumnListing($tableName); foreach ($columns as $column) { if (!in_array($column, $excludedColumns)) { ...
Share:

Tuesday, 11 February 2025

Laravel Cache on Redis

Deleting laravel cache when redis is applied Assuming the Laravel cache used redis$roles = Cache::store('redis')->rememberForever( "roles-123456", function () { return Role::where('team_id', 12345) ->get(); });Cache can only be cleared byCache::store('redis')->forget("roles-123456...
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.

About Me

My photo
For the past 10 years, I've been playing with codes using PHP, Java, Rails. I do this for a living and love new things to learn and the challenges that comes with it. Besides programming I love spending time with friends and family and can often be found together catching the latest movie or planning a trip to someplace I've never been before.