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)) { ...
Wednesday, 12 February 2025
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...